Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To exclude the generated code from sonar analysis on Quality violation

Tags:

sonarqube

The generated code is present in a separate target folder path like: target/generated-sources/fod1/fod2/*.java

I have been trying several option but in vain please help.

<properties>
    <sonar.exclusions>**/generatedsources/fod1/fod2/**/*.java</sonar.exclusions>
</properties>

I have tried the option from one of the posts also **/*generated*

like image 500
codeCrack Avatar asked Sep 03 '13 06:09

codeCrack


2 Answers

See the documentation in the General Settings > Exclusions page. The pattern file:**/generated-sources/** will do the job if you're not using a too old version of SonarQube.

like image 184
Freddy - SonarSource Team Avatar answered Nov 17 '22 08:11

Freddy - SonarSource Team


On SonarQube 5.4, the exclusions for duplications are on General Settings > Analysis Scope, on the Duplications tab

like image 22
DamCx Avatar answered Nov 17 '22 08:11

DamCx