How to exclude generated code from sonar processing and reporting?
I tried to exclude **/*generated*
but packages like org.blayo.generated
are still in report:
<plugin>
...
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<excludes>**/*generated*</excludes>
Edit: The right regular expression was **/generated/*.java
To use exclusions to analyze only the specified subset(s) of files in sonar. sources , go to Project Settings > General Settings > Analysis Scope > Files. You can set these properties at both the project and global levels.
You can not modify the built-in profiles. If you don't see the option of Deactivate, then copy the profile and set it as default. Now you will see the options to activate/deactivate. Show activity on this post.
The exclusion pattern has changed since SonarQube 3.5. Here is how it works now:
<properties>
<sonar.exclusions>file:**/generated-sources/**</sonar.exclusions>
</properties>
Source: SonarQube JIRA
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With