We are trying to exclude types from Sonar’s code duplication check, specifically in this case, the duplicated code is an annotation used to generate open API specs; however, Sonar is still including the types in the duplication metrics and our quality gate is failing because we don’t meet the quality profile requirements.
The glob pattern we are using for code duplication exclusion is
**/Triggers/Http/**/*
- ALM used -
Azure DevOps
- CI system used -
Azure DevOps
- Scanner:
sonar.scanner.app=ScannerMSBuild sonar.scanner.mode=dotnet
- Languages of the repository -
C# dotNet
- Steps to reproduce
See background processor task AZawxZHEsFDSJEdYTb9X
Setting code duplication exclusions via the ADO yaml pipelines eg.
sonar.cdp.exclusions=**/Triggers/Http/**/*
per the online documentation about the accepted glob matching patterns
Defining matching patterns | SonarQube Cloud Documentation
Could you confirm if the global pattern is valid, and or correct for the duplication warnings raised in the background task referenced?
Please let me know if there is any additional info you need, thank you in advance.