Code coverage shows as 0%

Hi SonarSource team,
I am using version 6.7.5 of SonarQube and Jacoco Agent 0.8.2 on the app servers, and I am facing an issue where all my metrics like code smells get published, but “Code Coverage” is zero percent.

I have noticed that when I run mvn sonar:sonar from my laptop to publish report from my jacoco.exec, I get the following non-critical error regarding Lizard Report:

[INFO] Sensor Cobertura [backelitesonarswiftplugin] (done) | time=0ms
[INFO] Sensor Lizard [backelitesonarswiftplugin]
[INFO] Processing complexity report
[ERROR] Lizard Report not found /home/kram/C_C/trial2/app/appReportMetaDataLibrary/sonar-reports/lizard-report.xml /home/kram/C_C/trial2/app/appReportMetaDataLibrary/sonar-reports/lizard-report.xml (No such file or directory)
at Method)
[INFO] Saving results of complexity analysis
[INFO] Sensor Lizard [backelitesonarswiftplugin] (done) | time=1ms
[INFO] Sensor FindBugs Sensor [findbugs]

I am interested in knowing:

  1. Why does it look for the xml report, when I have the binary exec data available? Has publishing from exec data been deprecated?
  2. If deprecated, where can I enable the Lizard report?
  3. If not deprecated, how do I force sonar to look only at the exec file?

Thanks in advance.

Hi Karthik,

SonarQube 6.7.5 is far beyond end of life. We’d recommend you upgrade to at least the 7.9.4 release. And then you’ll find that support for the .exec format of JaCoCo is since completely removed. You’ll need to generate a JaCoCo XML report to get code coverage going forward. We wrote a guide to help with this.

Re: the Lizard error, that appears to be coming from a plugin you added to your instance and doesn’t appear related to the problem you describe.

Thanks for the quick response Jeff! We tried publishing on a different environment and code coverage was reported successfully without the Lizard plugin. So the issue doesn’t seem related with Lizard report, must be an issue with the way I collected coverage to form the jacoco.exec.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.