Search code examples
junitsonarqubecobertura

Ignore uncovered line with SonarQube and Cobertura


I am using sonar with Cobertura and a have some classes like this:

uncovered annotation

How can I make SonarQube/Cobertura to ignore this annotation? I am testing the class, but not in the server context.

I tried the // NOSONAR but it did not work.


Solution

  • This is not possible to tell SonarQube to ignore this annotation. You might wanna try with JaCoCo coverage engine, maybe it will give better results (?).