Sonar coverage on PR issue

SonarQube ID information
Server ID: 4E0B12C0-AWx3FFVJ-rodZ4C38Nhp
Date: 2021-02-03

Hello, as per my previous bug, I was told that PR with less then 20 lines of code will not fail the QG, but main branch will fail:

As you can see from the following example, this doesn’t seem to be consistent:
(6 not covered lines of code causing a failure in the merge request)


Hello @fmunteanu
sorry for the delay here.
In case you did not figure it out for yourself in the last two weeks, the screenshot you provided was for a PR with 218 lines of New Code. This PR was therefore considered large enough for the Quality Gate coverage conditions to apply.


Hello, but the coverage box says: “Coverage on 6 New Lines to cover”.
And the MR was actually made of only 6 new lines of code.

yes there are 6 new lines that need to be covered by tests, the lines to cover count.
The measure of whether or not a PR is big enough for the Quality Gate coverage conditions to be considered is made on the New Lines indicator though, these new lines may include lines from Tests code, comments… If you select this 218 count in SonarQube UI, you will be able to see what are those changes.
Best regards