# Use overall code coverage conditions as quality gate on Pull Requests

**URL:** <https://community.sonarsource.com/t/use-overall-code-coverage-conditions-as-quality-gate-on-pull-requests/70109>\
**Category:** Suggest new features\
**Tags:** bitrise, android, sonarqube, coverage\
**Created:** [August 19, 2022, 12:57pm UTC](https://community.sonarsource.com/t/use-overall-code-coverage-conditions-as-quality-gate-on-pull-requests/70109 "2022-08-19T12:57:01Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![vivek.reghunath](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/vivek.reghunath/32/68152_2.png) [@vivek.reghunath](https://community.sonarsource.com/u/vivek.reghunath)\
**Post date:** [March 17, 2026, 9:23am UTC](https://community.sonarsource.com/t/use-overall-code-coverage-conditions-as-quality-gate-on-pull-requests/70109/37 "2026-03-17T09:23:14Z")

</div>

Thanks for sharing this feedback. We will take a fresh look at this and share if I have an update.

---

<div class="post-metadata">

**Author:** ![jilles-sg](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jilles-sg/32/63285_2.png) [@jilles-sg](https://community.sonarsource.com/u/jilles-sg)\
**Post date:** [May 10, 2026, 9:34pm UTC](https://community.sonarsource.com/t/use-overall-code-coverage-conditions-as-quality-gate-on-pull-requests/70109/39 "2026-05-10T21:34:02Z")

</div>

Imposing a requirement on the overall code coverage percentage will inappropriately reject some kinds of pull requests:

- A pull request that removes unnecessary code that happens to have better coverage than the rest of the codebase.
- A pull request that improves (eliminating unnecessary verbosity) existing code that happens to have better coverage than the rest of the codebase.

Developers may be encouraged to leave in unnecessary code or to refrain from fixing other issues because of this requirement. Checking code coverage only on new code prevents most of these problems.

To catch mistakes like disabled tests from Jest’s `it.only` feature, rules like S6426 may be a better choice. For this to work, the rule must not be disabled and SonarQube must recognize the test code as test code (not as production code and also not completely ignored). If similar functionality in another test framework is not detected, consider reporting a separate issue about that.

[Previous page](https://community.sonarsource.com/t/use-overall-code-coverage-conditions-as-quality-gate-on-pull-requests/70109.md?page=1)
