ExcludeFromCodeCoverage

  • Version : 7.4

Hi,
Is there any solution to find ExcludeFromCodeCoverage attribute in source files?
We want to block usage of this attributes.

Thank you in advance.

Hi,

Any idea?

Thank you.

hi @ckonca

we don’t have a rule that detects the usage of ExcludeFromCodeCoverage attribute in the code

however, SonarQube is extensible and you can write a roslyn analyzer that detects this pattern. By default, all issues raised by roslyn analyzers during build will be imported in SonarQube (see docs)

1 Like

Thank you Andrei_Epure.

Hey @ckonca,

Did you manage to make this rule? I’m looking for something that help me.

@joao_paulo_moreira we have this new rule: “ExcludeFromCodeCoverage” attributes should include a justification C# static code analysis: "ExcludeFromCodeCoverage" attributes should include a justification

Hi Andrei,
Thank you for your help. Colin answered me in another thread that the option is available from SonarQube v10. We are planning to update our version of SonarQube.