[Coverage] Different (much lower) coverage in SonarCloud for Rails project

Hello,

I have a problem figuring out and hopefully fixing incorrect (in my opinion) code coverage calculations in SonarQube. Below are some more details and example files from SonarQube and from SimpleCov::Formatter::HTMLFormatter. In the whole project, we have ~96% of the overall code coverage but SonarQube is reporting only 67.5% :frowning:

Details:

  • SCM used: GitHub
  • CI system used: CodeShip Pro
  • Languages of the repository: Ruby
  • Coverage reporter: SimpleCov::Formatter::JSONFormatter
  • Sonar scanner version: 4.7.0.2747


Hey there.

We had a similar report in the past but couldn’t reproduce it (and lost the user to follow-up)

I’ve flagged this for some expert attention so that fingers crossed, we can get to the bottom of this.

Hello! Any update on this?