Sonar.exclusions decrease my code Coverage Percentage

Hi Team,

I have added few files in sonar.exclusion, those files ignored in analysis as expected but it took my Coverage Percentage down means those files still considered while calculating code Coverage Percentage?


Hi Pankaj.

Welcome to the SonarSource Community.

Yes, excluding files that were formerly in your analysis can decrease your percentage of lines covered by unit tests.

You are losing their contribution to that calculation, whether it was helping (because the lines were covered), or hurting (because the lines were uncovered).

Does that means those files were still considered while calculating code coverage percentage? No.