Sonarqube information:
Version: 8.9
Executed from Azure DevOps pipeline steps
Hello,
After upgrading from the earlier LTS version to 8.9, I noticed that one of our projects had 20 new bugs. Looking into it, the issues all came from the area path “Website.Elevate/Tests/src/…” so I navigated to “Project Settings->GeneralSettings->Analysis Scope” and added the source file exclusions as follows:
I am able to replicate this behavior on another one of our projects. I have a workaround of course, but I would like to be able to use the UI area for exclusions.
It looks like your exclusion patterns are incomplete. For example, if you want to exclude all files under Tests at any level, like for example Tests/src/folder/Foo.cs, then the pattern would need to be Tests/**/*. You need the first ** to match any possible directories between the root and the files and then the final /* to match the files in any directories traversed.
I don’t think the glob pattern is the issue though since the same pattern worked in the Azure DevOps build step, but not the UI area. I also tested **/*Test*/** in a couple of glob pattern testers and it picked up the file that had the bug which would have looked like Website.Elevate/Tests/src/tryitout.cs.
For your purposes, that expression would actually need to be **/*Test*/**/* to actually match files and not just directories beneath any directory with a name containing Test. I encourage you to try that literally rather than make an assumption based on a 3rd party glob expression tester.