Using advanced exclusion features
In very specific situations, you may have to define, at the organization level, the exclusion of code from the analysis using SonarQube Cloud's advanced exclusion features.
This feature is only available in the Enterprise plan.
In very specific situations, you may have to define at the organization 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 the organization. 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 organization 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:
Retrieve your organization. See Retrieving your organizations for more details.
Go to Administration > Analysis scope.
In 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.
Last updated
Was this helpful?