I would guess they are referring to the fact that the SonarQube algorithm for computing “Coverage” is not the same as line coverage in Cobertura or JaCoCo. From a high-level, SonarQube uses a “weighted average” of line coverage and condition coverage. Colin can provide more details.
Hey Colin,
I can paste some of our azure pipeline configuration, we are using this pipeline to collect coverage , it’s not compliant to paste all of them here, so I rename or change some keywords.
This is one of solutions that I can see data for coverage in sonarqube, however the coverable lines and code coverage data is not the same. For this project, in sonar coverable lines are 13k, and coverage is 79%, in cobertura result, coverable lines are 16k and coverage is 78%. In this project, the difference is not so big, but I config this in another C# project, it’s greater differences(60% vs 40%).
I got two questions, one is that why there is differences between opencover format result and cobertura result. And another is that given we are using cobertura to calculate coverage, is it possible to directly use cobertura result to sonar, then there will be no confusion.(I also tried this way, using sonar.flex.cobertura.reportPaths to import cobertura files, it’s not working so well, showing multiple files found…)