Sonarqube using the wrong metric to determine small changesets

Opensource Sonarqube version using Pull Request integration.

Our project is a mix of typescript and vue and we’re ignoring test coverage for the vue files.
We get PRs that are failed by the code coverage gate where only 2 lines of typescript code is changed and uncovered. The PRs usually have many changes to vue files, but as stated they are excluded from test coverage.

I had a look at the sonarqube source and the isSmallChangeSet function is using the CoreMetrics.NEW_LINES_KEY metric to determine whether the PR is smaller than the limit set by MAXIMUM_NEW_LINES_FOR_SMALL_CHANGESETS.
In my opinion this is incorrect and it should rather use CoreMetrics.NEW_LINES_TO_COVER_KEY.


Welcome to the community!

I agree completely with you. You may be interested in this ticket:

SONAR-11283 - Quality Gate should not fail when too few lines to cover