Coverage not properly reported

jacoco
java
coverage

(Nicolas Garcin) #1

Hi,

Since we moved to Java 8, it seems that coverage is not properly reported for some of our classes in SonarQube anymore after jacoco analysis. I retrieved the generated jacaco.exec file and ran the following command:

java -jar org.jacoco.cli-0.8.1-nodeps.jar execinfo jacoco.exec

In the output, I can find the following:

bd50a72c341d08f8 85 of 152 com/smartplanet/api/reporting/SmartReportingHelper

Which makes me think that this class is (at least partly) covered. But SonarQube reports 0% coverage on this class (whereas for other classes of the same project, coverage seems to be correct).
Any clue? Is there a way to activate more logs in order to understand this issue?

Thanks a lot!


(Nicolas Peru) #2

Sorry for the delay answering,
In order to help you, could you share which version of sonarJava you are using ? how do you run your analysis (which scanner) ? and if you are not using maven or gradle, how are you providing compiled classes of your project to the analyzer (ie : what is the value of sonar.java.binaries) property ?


(Nicolas Garcin) #3

Hi Nicolas,
Thanks for your answer. We finally reviewed our whole software factory and now it works properly! No need for help anymore :slight_smile:. Have a nice weekend,

Regards,
Nicolas