-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number "lines to cover" Clover vs Jacoco on Sonarqube #148
Comments
Hi! It's quite hard to tell without seeing two reports side-by-side. Would it be possible to see screen shots of source files with coverage highlighting for OpenClover and JaCoCo? Feel free to blur the code, if necessary. A single source file having the highest difference should be sufficient. At the moment I can think about the following possibilities:
|
ad 4. Judging from the https://github.com/sfeir-open-source/sonar-clover/blob/master/src/main/java/org/sonar/plugins/clover/CloverXmlReportParser.java#L113, it skips the tag in the clover.xml file. Instead of this, it counts lines "manually", see https://github.com/sfeir-open-source/sonar-clover/blob/master/src/main/java/org/sonar/plugins/clover/CloverXmlReportParser.java#L162. |
Thanks @marek-parfianowicz for your quick answer! From the Sonarqube forum https://community.sonarsource.com/t/number-lines-to-cover-clover-vs-jacoco/55832/5 they say "Lines to cover" means "Executable lines" I am not sure we are talking about the same thing, maybe you mean lines of code? As in my comment in the sonar clover plugin forum, I attach what I mean: Clover: https://imgur.com/a/o6hnKDN Jacoco: https://imgur.com/a/MAkNj68 |
As I wrote, I'd have to see full coverage information (either a Clover database with coverage recordings or HTML report; same for JaCoCo), ideally with build logs, in order to determine the root cause. You can contact me via [email protected]. |
Thanks @marek-parfianowicz The issue here is how I anonymized the data in the report. Can you tell me exactly which kind of report you mean with this phrase "Would it be possible to see screen shots of source files with coverage highlighting for OpenClover and JaCoCo? Feel free to blur the code, if necessary. A single source file having the highest difference should be sufficient" ? If you attach a screenshot of what you mean maybe I can reproduce it and send it blurred as you say. Also, again, I am not sure if we are talking about the same thing. From the Sonarqube forum: https://community.sonarsource.com/t/number-lines-to-cover-clover-vs-jacoco/55832/5 They say "Lines to cover" means "Executable lines". I´m just wondering why Jacoco and Clover differ so much on that calculation. Also I wonder how meaningful is that deviation since overall coverage numbers are pretty similar. |
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.
Any idea? @marek-parfianowicz ? I also have raised an issue in the clover sonar plugin sfeir-open-source/sonar-clover#57
The text was updated successfully, but these errors were encountered: