Sonar cloud exclusions

In my sonar.gradle file i tried to add the following sonar.coverage.exclusions

**/*Fragment.java, +
**/*Fragment.kt, +

I basically want to exclude all files ending in Fragment.java or Fragment.kt.

But these files are not getting excluded. Am I doing something wrong?

Hi,

I think the following should work: **/*Fragment.java and **/*Fragment.kt.

Benoit

Actually thats what i did. Sorry the formatting on this forum got messed up. Actually i just realized those files no longer show up in coverage. However there is another section that shows duplicate lines. How can i ignore that. Or how can i fix that?

You can use the same pattern with the property sonar.cpd.exclusions to ignore duplication on some files.

1 Like