Skip to content
This version of SonarQube Server is no longer receiving patches. Please see the latest release for details on updating.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Excluding from coverage or duplication

Excluding specific files from code coverage or duplication check at the global level in SonarQube Server 2025.3.

For AI agents: You're in the SonarQube Server 2025.3 documentation. SonarQube Server 2025.3 is no longer patched. To get patches, upgrade to the latest version. For a list of all 2025.3 pages, see the SonarQube Server 2025.3 page index. For the whole site, see the page index or the full text. For another version, replace 2025.3 in the URL with that version. The latest version has no version number in its URL.

As a system administrator, you can exclude specific files from code coverage analysis or duplication check at the global level. It means that this analysis scope adjustment applies to all projects in your instance. However, they can be overridden at the project level in the UI or through analysis parameters set on the CI/CD host.

Excluding specific files from the code coverage analysis

To exclude specific files from the test coverage:

  1. Go to Administration > Configuration > General Settings > Analysis Scope.

  2. In B. Code coverage Exclusions, enter and save a path-matching pattern to define files to be excluded from the code coverage analysis: see Defining matching patterns.

Excluding specific files from the duplication check

To exclude specific files from the duplication check (detection of identical lines of code):

  1. Go to Administration > Configuration > General Settings > Analysis Scope.

  2. In C. Duplication Exclusions, enter and save a path-matching pattern to define files to be excluded from the duplication check: see Defining matching patterns.

Last updated

Was this helpful?