Code coverage difference between local analysis and nemo analysis (lines coverage)

27 views
Skip to first unread message

Michel Pawlak

unread,
Sep 6, 2015, 4:55:03 AM9/6/15
to SonarQube
Hi,

I just realised that my code, when analysed locally has a code coverage of 82%, while on nemo it is only 72.4%. I checked and I confirm that it is exactly the same code, I use no exclusions locally nor special profile to build the project, so the only thing that may differ is the JDK.

The difference is related some files : on three files the difference is small (0.2% to 0.7%) but on one it is huge (6.7%) other files have the same coverage.

The difference is on line coverage only (83.6% locally, 72.9 on memo). Here is the file with huge difference... as you can see only 2 lines are not covered... I ckilcked on "details" locally and it states "lines 155/157" and on nemo "lines 34/36". Why ?

What JDK are you using for your builds ? Is there anything special I should know to be able to align local with nemo coverage ? 

Kind regards,

Michel


Simon Brandhof

unread,
Sep 9, 2015, 3:56:00 PM9/9/15
to Michel Pawlak, SonarQube
Hi Michel,

Oracle JDK 7 and Maven 3.0.5 are used. I send you the build logs privately.

Regards


Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/523847ac-d16b-4a5d-897e-9bd52ebbd2d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michel Pawlak

unread,
Sep 9, 2015, 4:43:00 PM9/9/15
to SonarQube, michel...@gmail.com
Hi Simon,

Thanks for your answer and for the logs. I tried to build the project locally with the same JDK and same Maven version you're using and I confirm that I get now the same results as the ones displayed on Nemo.

Maven version has no impact (I'm using 3.3.3 locally), the difference is due to JDK version (I'm using 1.8.0_51 and it looks like 1.7 compiler does not keep line information as accurately as 1.8 compiler)

At least now I know the root cause of this difference ^^

Regards,

Michel

Fabrice Bellingard

unread,
Sep 10, 2015, 10:10:05 AM9/10/15
to Michel Pawlak, SonarQube
Hi Michel,

I've updated the job to use JDK 8 and relaunched it. Please tell us if this fixes your issues.


Best regards,

Fabrice BELLINGARD | SonarSource
SonarQube Platform Product Manager
http://sonarsource.com

Michel Pawlak

unread,
Sep 10, 2015, 10:13:07 AM9/10/15
to SonarQube, michel...@gmail.com
Hi Fabrice,

Indeed it fixed it : Lines 155/157

Thank you
Reply all
Reply to author
Forward
0 new messages