Exclude classes with particular attribute from code coverage

We are using Azure DevOps.
SonarScanner version: 4.21.0.
SonarQube version: 8.7.1

Question: in dotCover (and other tools) I can filter out classes that are decorated with custom attribute. But, I couldn’t find how can I do the same in SonarQube (I can add exclusions that are based on file path, but my files are very distributed from this point of view).

I wonder is there any mechanism to achieve what I want, or maybe you can consider this as an improvement for your future versions?


There isn’t a mechanism to do this from within the files themselves, only externally. So I’m moving this to the New Features category.