How to identify "Condition Coverage on New Code"?

Hello everyone, good morning.

When releasing a new Pull Request, submitting new code, Sonar is counting coverage of 99.7%, however, it does not inform which line of code is missing a test.

Uncovered Conditions on New Code = 3
Condition Coverage on New Code = 99.4%

It is not clear where the coverage is missing.

  • Is this normal?
  • Could it be a bug?
  • Isn’t there some functionality within Sonar to resolve/identify this scenario?

One question, could this topic be related to my question?

Thank you.

Hi,

You should be able to find this through the PR’s Measures tab. If you click through on the overall coverage number from the PR homepage, you’ll land at the Coverage metric with a list of files in the PR and their coverage on code changed in the PR. Click through on a file and look for the ‘new code’ highlight, versus the red/green/striped marginal markers indicating coverage.

 
HTH,
Ann

Hello, good afternoon.
How are you?

Thanks for your feedback.

I even performed this analysis, going through every line of code looking for sections with red/green/striped, but everything is green.

There is no section of code marked red/striped indicating that adjustment is necessary.

Hi,

Your screenshot shows Coverage at 99.7%.

In the right pane, you should see a list of files. One of them will not be at 100%. That’s the file you want to click on and scroll through, looking for the missing coverage.

 
HTH,
Ann