We have a project that is doing branch analysis on merge requests and has a quality gate on new code coverage that fails if the new code coverage is below 65% for any given branch analysis. There is a branch that has 30 lines of new code, but only 2 lines of testable code (the other 28 lines are a new test class that adds coverage for code that existed prior to the merge request).
First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:
8.8 → 8.9.2 → 9.1 (last step optional)
Regarding your actual question, you’re interested in this ticket:
SONAR-11283 - Quality Gate should not fail when too few lines to cover
We are also running into a similar issue with the New Code and Lines to Cover being small. We added 25 lines of code, mostly tests and documentation. There’s only 1 actual line to cover, which the team feels would not make a useful test.
You mentioned SONAR-11283, but that feature request is three years old. Do you have any insight on when the issue will be prioritized or resolved?