# Excluding from coverage or duplication

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 <a href="#from-coverage" id="from-coverage"></a>

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](https://docs.sonarsource.com/sonarqube-server/project-administration/adjusting-analysis/setting-analysis-scope/defining-matching-patterns "mention").

<figure><img src="https://2744305742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3VWSqvZ4eaBLWvA6epdv%2Fuploads%2FcxSSSrsP6fCRLF76XH14%2Fadmin-analysis-scope-b-c.png?alt=media&#x26;token=9f7397b2-cf11-4c43-a61e-0b6d1883f1a8" alt="Setting analysis exclussions"><figcaption></figcaption></figure>

## Excluding specific files from the duplication check <a href="#from-duplication" id="from-duplication"></a>

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](https://docs.sonarsource.com/sonarqube-server/project-administration/adjusting-analysis/setting-analysis-scope/defining-matching-patterns "mention").

## Related pages <a href="#related-pages" id="related-pages"></a>

* [excluding-files-based-on-file-paths](https://docs.sonarsource.com/sonarqube-server/instance-administration/analysis-functions/analysis-scope/excluding-files-based-on-file-paths "mention")
* [advanced-exclusion-features](https://docs.sonarsource.com/sonarqube-server/instance-administration/analysis-functions/analysis-scope/advanced-exclusion-features "mention")
* [setting-analysis-scope](https://docs.sonarsource.com/sonarqube-server/project-administration/adjusting-analysis/setting-analysis-scope "mention")
* [test-coverage](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/test-coverage "mention")
