Incorrect sonar coverage metrics in sonar cloud

Hey Guys analysis id “AXV6YCwE6ZXbWzyafjiM” keeps on showing incorrect coverage metric in sonar cloud.
And it considers test files as source file and coverage metrics as 0%.

We are not able to figure it out atm.
Would request some community support.

It’s a private repository with a paid sonar cloud subscription.

  • ALM used (GitHub)
  • CI system used ( Circle CI )
  • Languages of the repository scala

Hi @pankajb23,

SonarCloud and the Sonar scanner try to detect automatically source and test files. It seems the automatic way don’t fit your project structure, mixing tests and sources.
The analysis scope can be configured using the Analysis scope configuration documentation, to specify source and test file patterns to match your project.

Considering the coverage, my first guess is the coverage reports are not found. If your project structure is not appropriately supported by the automatic detection, then the scanner may not be reading the coverage reports at the right place.
Scala has a specific configuration option, sonar.scala.coverage.reportPaths, that can be used to override the default paths.