Problem when PR has less than 20 new LOCs

Hi teams,

I am using Sonarcloud to ensure my company code. I use default quality gate with 80% code coverage need to be done. Then i get caught of this problem which really miss our expectations of the analysis:
When we create a new PR with 16 new lines of code, sonarcloud said that the number of new LOC is too small so they do not scan as “Some Quality Gate conditions on New Code were ignored because of the small number of New Lines”
However, when we merge the PR into master, the analysis for master branch said that it’s fail due to code coverage
image
I really believe that if we merge an accepted branch into master, master branch must pass the quality gate too.
Thanks

Greetings!

Thanks for reaching out about this.

If you’re interested in the history of why we have this 20-line threshold, you can check out SONAR-9352.

We recognize there are some cases where this isn’t ideal, and I’d encourage you to vote for SONAR-10485 - Provide a way to configure the Quality Gate fudge factor

Colin

2 Likes

Thanks Colin,

I already vote for Sonar-10485. Wish you can suply the solution soon.
Thanks.

Sorry to reopen this, but there doesn’t seem to be any way to submit this feedback apart from Contact Support > Purchasing/Billing Request.

The 20 line threshold for code coverage scan to trigger would have been nice to know about before wasting 3 days debugging why code coverage wasn’t being considered on my 5-line function for testing integration.

I searched all of the documentation and this post was the only place it seems to be referenced. Could you guys please update the tutorials/docs to mention this explicitly?