WiSeeker
WiSeeker

Reputation: 842

Does C# plugin 5.0 for SonarQube ignore csharpsquid:S3217 rule?

I updated C# plugin from ver 4.5 to 5. In order to validate the plug-in upgrade, I did an analysis before and after. "After analysis" showed 6 issues less than "before analysis". Note that there was no change to code between before & after analyses (the only difference is before was scanned with C# plugin 4.5 and after was with 5.0). Both analyses were run in preview mode.

When I diffed the generated report, I noticed that there were 6 instances of ""Explicit" conversions of "foreach" loops should not be used (csharpsquid:S3217)" which were missing in after analysis.

Is there a reason why 5.0 plug-in would no longer consider this as an issue? Is anyone else seeing this?

PS: We're on SonarQube 5.2.

Upvotes: 0

Views: 776

Answers (1)

Tamas
Tamas

Reputation: 6420

There was some fine tuning of the rule S3217 lately to reduce noise produced by the rule. Specifically, on legacy code the rule reported a lot of issues, and therefore we modified it as part of https://jira.sonarsource.com/browse/SLVS-769

Note that the rule description has also changed. See the exception part of the rule documentation site, which says

The rule ignores iterations on collections of objects. This includes legacy code that uses ArrayList. Furthermore, the rule does not report on cases when user defined conversions are being called.

Upvotes: 1

Related Questions