Hello,
We are using SonarQube Community Build 26.1.0.118079.
We are experiencing an issue where Source File Exclusions configured at the project level do not seem to be applied. However, the same exclusion pattern works correctly when configured under Global Source File Exclusions.
For example, we are using the following pattern:
**/Content/**
We performed the following tests:
- Administration → Analysis Scope → Global Source File Exclusions
With:
**/Content/**
files under the content directory are successfully excluded from the analysis.
- Administration → Analysis Scope → Source File Exclusions
When the same pattern is configured here, the files are still analyzed.
- Project → Administration → Analysis Scope → Source File Exclusions
When the same pattern is configured only at the project level, files under the content directory are still analyzed and issues are reported.
We also checked the following:
- We checked whether
sonar.exclusionswas being configured on the Azure side and temporarily removed it for testing. - We confirmed that the project-level
sonar.exclusionsvalue is visible in Show SonarScanner Context. - We confirmed that the exact same exclusion pattern works when configured under Global Source File Exclusions.
- Therefore, we do not believe this is related to the wildcard pattern itself.
- We also recreated the project and performed a new analysis, but the behavior remained unchanged.
One example of a file that should be excluded is:
code/Source/Web/Features/Custom.FrontEnd.Common/Content/less/3rdParty/elements.less
code/Source/Web/Features/Custom.FrontEnd.Common/Content/less/3rdParty/front.js
Project-level exclusion:
**/content/**
However, this file is still analyzed and issues are reported for it.
Questions:
- Is there any known issue with Project-level Source File Exclusions in SonarQube Community Build 26.1.0.118079?
- Is there any known reason why
sonar.exclusionscan be visible in Scanner Context but still not be applied during analysis? - Is it expected behavior that Global Source File Exclusions work while Project-level Source File Exclusions do not?
- Can using SonarScanner for .NET affect this behavior?
Thank you.