Sonar-scanner documentation could use improvement

I’ve recently had a problem at work that I couldn’t solve, because the documentation has holes in it.

Only by dumb luck I’ve managed to find this article Scala SBT sonarqube configuration | by venkateswararao yeluru | Medium and find that my problem is going to be solved by defining " sonar.scala.scoverage.reportPath" instead of “sonar.scala.coverage.reportPaths”.

For the record here is what has to say about these variables:

  • “sonar.scala.scoverage.reportPath” mentioned 0 times in search results
  • “sonar.scala.coverage.reportPaths” mentioned 1 time in search results, in Test coverage parameters where it says this is where it expects Scoverage reports to be located

Setting “sonar.scala.coverage.reportPaths” was basically a no-op. The scanner would never inspect that location. Only setting “sonar.scala.scoverage.reportPath” seemed to have any effect on the scanner.

This happened with SonarScanner

I think the properties with which sonar-scanner can be configured should be better covered and the list on Test coverage parameters should be exhaustive. If this is 1 undocumented variable, it only makes you wonder how many more there are :confused:

Edit #1: I’ve just found this sonar.scala.scoverage.reportPath not honored · Issue #67 · sonar-scala/sbt-sonar · GitHub and it turns out the undocumented variable belongs to a discontinued plugin for sonar-scanner. I’ve grepped the project that I’ve noticed uses this old plugin, but I couldn’t find any direct clues as to why we’re using sonar-scala instead of the official SonarScala.
Edit #2: I’ve found out that it’s the SonarQube server that determines plugins available for sonar-scanner. See the endpoint /api/plugins/installed on your server.

1 Like