Exclude all code from a module from coverage

Hi all!

We have a common quality gate that all projects / Gradle modules are analyzed with. In order to not have to configure too many things manually in the SQ UI, we try to do as much via analysis properties as possible.

For Gradle modules that contain test-support code or that are API modules (only containing interfaces and POJOs) we want to find a way to disable code coverage collection and for that matter a failing quality gate when “newly added code” does not fulfill the set coverage target.

I figured the easiest would be to set the property sonar.coverage.exclusions to **/*.* but this apparently does not work, as SQ still reports “0% Coverage on XXX Lines to cover” in the “Overall” project tab.

Am I doing something wrong or are there other ways of deactivating coverage signalling for specific modules?

Hi,

Yes, that’s the way I figure it too. How are you setting that value?

Could you provide screenshots, redacted as necessary, as well as your analysis log, again redacted as necessary?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Thx,
Ann