Using advanced exclusion features
Information on using the advanced exclusion features in SonarQube Server at the global level.
In very specific situations, you may have to define at the global level the exclusion of code from the analysis:
File exclusion based on the file content.
Exclusion of blocks within files.
Exclusion of specific files from specific coding rules.
Such an analysis scope adjustment applies to all projects in your instance. However, it can be overridden at the project level in the UI or through analysis parameters set on the CI/CD host.
This feature requires the Administer System permission.
Excluding files based on file content
You can exclude from the analysis files that contain a block of code matching a given regular expression. You can enter one or more regular expression patterns. Any file containing at least one of the specified patterns will be ignored.
The parameter to be configured is Ignore Issues on Files.
To define the Ignore Issues on Files parameter:
Go to Administration > Configuration > General Settings > Analysis Scope.
In D. Issue Exclusions > Ignore Issues on Files, enter and save a regular expression pattern.
You can enter a second regular expression pattern and so on.
Excluding blocks within files
You can exclude from the analysis specific blocks contained in any source file (The rest of the file will be analyzed.). The parameter to be configured is Ignore Issues in Blocks.
Excluding specific files from specific coding rules
This section explains how to exclude specific files from specific coding rules in your project analysis.
Related pages
Last updated
Was this helpful?