Sonarqube 8.9.2 LTS. Latest version of Sonar-Clover 4.1 plugin
Compare results on the same code base using Jacoco and Clover
I have managed to ingest the coverage reports of both but numbers don´t match
Our team has switched from Jacoco to Clover to ingest coverage reports into Sonarqube 8.9.2 Community Edition.
I have performed scans over two different projects with exactly the same code. One project I am using Clover and the project I am using Jacoco.
I have read in some forums that there might be a discrepancy on how the stastistics are calculated but I find weird that the overall “Lines to cover” under Jacoco are around 1k and under Clover are around 250 lines.
Checking the Measures tab under Sonarqube and running through the different packages I find that same java package reports 292 lines to cover in Jacoco based project while it reports only 62 lines to cover under the Clover project.
If I click on the top right “hamburguer” menu the “File measures” option. the number of lines, lines of code and comment lines are exactly the same but on the Coverage column is where the discrepancy shows.
But anyway @Colin I was wondering…Clover plugin is not supported but Jacoco is included in Sonarqube code. I am wondering how the “Lines to cover” are calculated? What does this number mean? Any documentation on that matter? I want to understand what is measured with that number
The coverage reports themselves tell SonarQube what lines can be covered by tests (which lines are “executable”). When file is included in a coverage report, we follow these guidelines.
And – when a coverage report provides information on a file, we listen to the coverage report and ignore this data. It seems like Clover only marks certain lines as being executable, while JaCoCo marks more.