SQL files are ignored when using the Sonar Scanner for MSBuild


I’m using the following:
SonarQube 7.9.1
Sonar PlSql 3.4.1
SonarScanner for MSBuild 4.6.2

So I’m scanning a .sln file which (eventually) references some *.sql files, and I noticed they are missing from the results…

At first I thought that, since *.sql files are not technically PL/SQL code then this is why they are ignored, but then I looked at the plugin configuration and I saw that sql is listed as a File Suffix by default.

Running the scan in debug, I see the following:

  • the scanner does acknowledge the *.sql files in its “sonar.sources” list
  • but then I see: Declared extensions of language PL/SQL were converted to sonar.lang.patterns.plsql : .pls,.plb,.pks,.pkb,*.pck (no *.sql)
  • finally the sql files are "indexed with language ‘null’"

Server side, sonar.plsql.file.suffixes=sql,pls,plb,pks,pkb,pck so I don’t understand why sql is forcefully ignored…

LE: after adding sql to sonar.lang.patterns.plsql the files are scanned properly. Guess the issue here is that the MsBuild scanner doesn’t convert sonar.plsql.file.suffixes to sonar.lang.patterns.plsql?


Hi Mihai,

Where did you look at the plugin configuration? This language configuration can be set at both the project and global levels, and overridden in the analysis properties and the command line. (Full precedence described in the docs.)

Probably you looked at one of the first levels and the value is being subsequently overridden in another level.


1 Like

Thanks, @ganncamp.

I just checked and you were right, file suffixes were overriden in the UI project properties - wasn’t aware that this was a possibility :slight_smile: