Problem - Analyst not related file on each PR

Last week, In our project (SonarCloud + Azure DevOps) we have an issue. We received some comments on files that aren’t related to PR or changed. We didn’t any changes to the SonarCloud configuration and before that it was okay.
Today I set “Previous Version” in the new code in the administration setting but it doesn’t fix.
I don’t know how to trace and find the problem and how to fix it.

Hi,

Welcome to the community!

There’s not a lot to go on here. Can you provide some screenshots of the unexpected comments?

Also, in the context of a PR, new code is determined by what was changed in the PR, so your project-level setting won’t have an impact.

 
Ann

1 Like

This is a sample screenshot.

Hi,

Thanks for the screenshot! The external_roslyn part indicates that these issues didn’t come from our analysis, but were automatically passed through from other rules triggered during your compilation.

Did you recently add other analyzers to your job?

When other Roslyn rules fire, we simply pass the issues forward. I guess what’s happening is that while our own results are limited to what changed in the PR, the other analyzer’s are not.

 
HTH,
Ann

I remembered we tried to test Defender for DevOps but I’m not sure the test time was before or after this issue. You mean, maybe this issue comes from Defender for DevOps or other third analysers.
Anyway, let me check with our team and I will back if we have question.

1 Like