Problem with scanning VB.NET code

  • SonarQube 7.9
  • scan VB.NET code
  • followed the instructions

Hello,

One of the teams in our organization is using VB.NET. SonarQube scan reports successful execution, however, it does not show any code analysis. I think on of the problems is that there are XML files with embedded JavaScript code. Is there any way to analyze these type of code?

Thanks,
Armenak

Hi @armenak ,

Presence of XML files should not affect VB.NET analysis. Can you tell us more about how do you build your project and what Scanner for .NET version are you using?

it is giving ERROR: unable to parse file1.vb and it gives such error in all the pipelines.I have used this line in groovy to scan “${tool ‘sonar-msbuild’}/SonarScanner.MSBuild.exe” begin /k:“${jsonInfo.SonarQubeProjectName}” /n:“${jsonInfo.SonarQubeProjectName}” /d:sonar.lang.patterns.vb=“**.vb”

Hi,

sonar.lang.patterns.vb is a parameter for VB6 analyzer.

Just remove it.

btw SonarQube 7.9 is not an active version anymore. Please consider updating to the latest 9.9 or 10.5.1. In the past, VB6 and VB.NET analyzers collided on .vb extension (I personally don’t remember what version was affected). If this is the case, set the VB6 pattern to something nonexistent

/d:sonar.lang.patterns.vb=“ignore.vb6”`