I am trying to use sonar.inclusions filter to speed up analysis of our c# projects, by limiting analysis scope to files which has changed since last version. But for some reason quality gate doesn’t include newly added files to a “New Code”, even though these files are analyzed and issues are indeed detected.
Minimal example for this bug goes like this:
- Create new project in SonarQube
- Set quality gate conditions to Blocker, Major, Minor, Info counts >= 0 on New Code
- Analyze master branch fully - with default filters including **/*.cs
- Set new code period to a specific version - previous analysis
- Then add single commit touching file a.cs with some code smell, and create file b.cs with code smell also
- Set sonar.inclusions setting for project to include only a.cs and b.cs
- Run analysis of new commit.
Actual result - quality gate detects only new code smell in a.cs as New Code, ignoring code smell in b.cs.
Expected result - quality gate detects both code smells in a.cs and b.cs as New Code
- versions used: SonarQube Community 8.4, sonar-scanner-msbuild-18.104.22.1680-net46