Dear community! Here it’s my setup:
- SonarQube Server Enterprise Edition v2025.1
- installed from .zip
- Importing cobertura.xml report produced by Squish Coco
- To have the most accurate condition coverage results for C++ project
Issue:
With squish coco I am able to export cobertura report with various coverage level (see: cmreport – Code coverage report generation | Coco Manual ) like:
-
--coverage-mcc: Report multiple condition code coverage measurements. -
--coverage-mcdc: Report MC/DC coverage measurements. -
--coverage-condition: Report condition coverage measurements. -
--coverage-decision: Report decision coverage measurements. -
-b | --coverage-statement-block: Report statement (block) coverage measurements. -
--line-coverage: Report line coverage measurements. -
--function-coverage: Report function coverage measurements. -
--coverage-line: Report line coverage measurements (alias to--line-coverage). -
--coverage-function: Report function coverage measurements (alias to--function-coverage).
Let’s say I have coverage metrics available for all levels so I can choose any of the levels when exporting to cobertura.xml report. Question is, what level would be the recommended according to the SonarQube’s best practices, ideally most accurate and the easiest to consume by SonarQube.
What I am facing at the moment is that the values displayed in squish coco browser vs the final results in SonarQube are a bit different. I am aware of this article here SonarQube and code coverage although it’s quite old so I wonder if something has changed in that matter. And maybe by using some specific configuration when generating cobertura report might close that gap between them.
If not possible than it would be nice to at least use the recommended coverage level type (if there is one)
Thank you for your help!
Longi