Coverage Percent changes after it reaches SONARQUBE

Hello Everyone,

    • Developer Edition Version 9.9, OpenCpp Coverage Plugin, OCCSonarQube Plugin
  • what are you trying to achieve - Code Coverage Percent’s show the same number after running SonarScanner to upload SonarQube.xml to SonarQube
  • what have you tried so far to achieve this - Updating the buildwrapper, Excluding false tests.

We have been using the project GitHub - OpenCppCoverage/OpenCppCoverage at 71c622215f18d76aeabe35c45440b744f7c55ca8 to get our code coverage and we have noticed that if we export or data as html we get one number of coverage data and then if we export using an export type of SonarQube.xml the same tests are being run but when we run sonarscanner to scan the SonarQube.xml and upload it to SonarQube the numbers dont match one project shows a difference of about .7% but another shows a difference of 15% so im trying to understand what happens during the sonarscanner process that changes the coverage percent number? I can provide pictures of one of the projects if needed.


You didn’t say which import yields higher numbers, nor which is more accurate.

It looks like OpenCpp isn’t directly supported…? So at a guess the import of the “SonarQube.xml” is more accurate.

You’ll need to provide full analysis logs from both runs for a more in-depth opinion.

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.