SonarCloud passes on low coverage

Hello!

My sonar check passes on PRs, despite the low coverage on the new code.

I’ve added two one-liners with no tests. Sonar was able to find the non-tested code and show that 2 new lines need to be covered. It correctly shows 0% coverage. However, the quality gate passes.

The quality gate of the project is set to Sonar Way, which requires at least 80% of coverage.


Version:
org.sonarqube.sonar
version 3.4.0.2513

Interestingly, it seems to be working if the coverage is != 0.0%. To the same PR, I added one test.
Then a check failed as expected with 50% coverage.

Hi,

Here’s the important part:

passing Selection_632

failing Selection_633

Coverage conditions aren’t applied when fewer than 20 lines have changed.

 
HTH,
Ann

Why should coverage conditions have more than 20 lines of change?

Hi @hendra1,

Welcome to the community!

You’ve resurrected a thread that’s nearly 2 full years old. Per the FAQ, please don’t do that. Please create a new thread with all your details.

 
Ann