# Sonarqube New Code Coverage Quality Gate on Low # of Testable Code

**URL:** <https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847>\
**Category:** SonarQube Server / Community Build\
**Created:** [October 4, 2021, 11:45pm UTC](https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847 "2021-10-04T23:45:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aqasquad](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@aqasquad](https://community.sonarsource.com/u/aqasquad)\
**Post date:** [October 4, 2021, 11:45pm UTC](https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847/1 "2021-10-04T23:45:07Z")

</div>

Must-share information:

- Sonarqube Enterprise v8.8
- Jacoco v8.6
- Android, Kotlin, Java project

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).

Some questions we have are:

- Can we configure sonarqube to ignore lines of untestable code (like for example, our test class) in the threshold for enforcing a quality gate (referring to [[SONAR-9352] Quality gate should not fail when too few new lines of code - SonarSource](https://jira.sonarsource.com/browse/SONAR-9352) it seems to be 20 lines or greater)
- Does the “estimated coverage after merge” take into account tests that are added to cover code that existed prior to the MR?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [October 5, 2021, 7:22pm UTC](https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847/2 "2021-10-05T19:22:49Z")

</div>

Hi,

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](https://jira.sonarsource.com/browse/SONAR-11283) - Quality Gate should not fail when too few lines to cover

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![chrism](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@chrism](https://community.sonarsource.com/u/chrism)\
**Post date:** [October 29, 2021, 7:49pm UTC](https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847/3 "2021-10-29T19:49:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [November 1, 2021, 11:45am UTC](https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847/4 "2021-11-01T11:45:55Z")

</div>

Hi @chrism.

Welcome to the community!

In fact the request is even older, since it was originally raised in this earlier ticket which was eventually closed as a duplicate:

> [SONAR-10231](https://jira.sonarsource.com/browse/SONAR-10231) - Refine metric used by Quality Gate fudge factor for coverage

When will it be addressed? I wish I knew.

&nbsp;  
🤷‍♀️  
Ann

---

<div class="post-metadata">

**Author:** ![chrism](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@chrism](https://community.sonarsource.com/u/chrism)\
**Post date:** [November 1, 2021, 3:29pm UTC](https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847/6 "2021-11-01T15:29:02Z")

</div>

@ganncamp Thank you for the welcome and providing that update. Can I upvote the feature or do anything to try and help prioritize that feature?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [November 1, 2021, 3:52pm UTC](https://community.sonarsource.com/t/sonarqube-new-code-coverage-quality-gate-on-low-of-testable-code/50847/7 "2021-11-01T15:52:01Z")

</div>

Hi,

I believe you should be able to sign up for a Jira account & upvote the ticket.

&nbsp;  
Ann
