Do the External Analyzers Consider Excluded Files?

Hi all,

I have recently upgraded to version 8.9 LTS SQ from the previous LTS version. I have noticed that our code smells have jumped WAY up on our projects and 99.9% of them are from MSBuild’s third-party Roslyn analyzer. I don’t mind it finding more things to fix, but it is picking up code smells from files I have marked to be excluded. I would like confirmation that this is expected behavior?

My plan is to turn the “exclude external analyzers” toggle on in Admin settings, but I wanted confirmation first in case there is something I’m missing with my exclusions.


UPDATE: Having turned on the flag, I’m still getting some test files picked up so I have another question open for my exclusion patterns. That being said, I’m still curious about if the results from the 3rd party source would consider my exclusions.


Hi @Gracie,

Can you show your Sonar scanner DEBUG logs (add sonar.verbose=true to the BEGIN step for Sonar Scanner for MSBuild)? This will show the exclusions/inclusions applied to your project. Most likely you will need to review your analysis scope as explained in Narrowing the Focus. If the exclusion/inclusion parameters are already set correctly, then modifying the “Ignore issues from external Roslyn analyzers” toggle is fine then.

Please also read Sonar Scanner for .NET: Excluding projects from analysis, which explains how to exclude a project from your .csproj file if you want to exclude an entire project.


This was solved in the related thread: Help on Formatting the Exclusion Pattern?

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.