Sonarqube PHP Code coverge is different than the value calculated by Clover

Hello,

I have Sonarqube version 10 Comunity edition and I’m trying to import the code coverage generated by phpunit in clover xml format. The file is imported corectly but when I check In sonarqube at overall code the coverage is 38.6% but in jenkins clover plugin shows 50.8%. I have also a custom library which calculates the coverage from the xml file following How are the Clover coverage percentages calculated? | Clover Data Center and Server 4.1 | Atlassian Documentation and I get the 50.8%.

Is Sonarqube Overal Code Coverage something else ? When I look at the coverage i see only php files.

Thanks for help!

Hey there,

Reading Clover’s documentation, it seems aligned with how SonarQube calculates coverage (a combination of line and branch coverage).

I think it would be quickest if you look for one specific discrepancy between the Clover and SonarQube report (a file, a line) where coverage is reported differently, and report back with what you find.