SonarCloud not flagging all code in class as covered or uncovered

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
    Azure DevOps
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI)
    Azure DevOps
  • Languages of the repository
    C#

We’re seeing files partially marked as covered or uncovered and partially unmarked. For example, a class contains a public method and a private method called by the public method. The private method shows the green covered and red uncovered markers on its code, but the public method shows no markers at all. Another class has three public methods and one private one. Two of the public methods and the private method show green covered and red uncovered markers on their code, but one of the public methods shows nothing.

Any idea why this might be happening?

Hey there.

SonarCloud relies on the coverage report being imported to know what lines can/can’t be covered by code. I would suggest checking your coverage tool / the coverage reports being produced.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.