Start Free
SonarQube Community Build | Instance administration | Global analysis setup | Analysis scope | Excluding from coverage or duplication

Excluding specific files from code coverage analysis or duplication check at the global level

On this page

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 code coverage analysis:

  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 path-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 path-matching patterns.

Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License