[Android] Code Coverage decreases but Quality Gate throws 0%

Hi, everyone!

We’ve recently implemented SonarCloud’s manual scanner into our CI workflow to analyze our repository. It was integrated with Gradle and it works very well in branch analysis and pull requests, but we found something weird (or maybe not) in code coverage section.

I generated a new PR where I deleted an entire test file, but we noticed that Quality Gate information is too different from Codecov (our current code coverage tool) because it doesn’t show how this change affects target branch if it is merged into it.

SonarCloud PR message:

Codecov example (from another PR):

As you can see, SonarCloud throws 0% increase of code coverage while Codecov shows a negative percentage when one or more tests are missing. Does exists in your roadmap the possibility to integrate this kind of feature? It would be very valuable for the community!

Many thanks in advance!


  • ALM used: GitHub
  • CI system used: Bitrise
  • Scanner command used when applicable: ./gradlew sonarqube --info
  • Languages of the repository: Java and Kotlin

Hey there.

In SonarCloud, Pull Request Analysis focuses exclusively on New Code – while it appears CodeCov is calculating coverage for the entire codebase (except for an Estimated after Merge % measure available on the PR dashboard that can’t be used in Quality Gates).

And, we are used to requests that suggest it would be useful for our products to say “Coverage must not decrease”. I think we can add your feedback to the list as we consider our future roadmap. :slight_smile:

1 Like

Thank you so much for your response, @Colin. We hope you can add it soon :raised_hands:t3: