Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S2930: Should report on all classes implementing IDisposable #326

Closed
fmallet opened this issue May 18, 2017 · 4 comments
Closed

Fix S2930: Should report on all classes implementing IDisposable #326

fmallet opened this issue May 18, 2017 · 4 comments
Assignees
Labels
Type: False Negative Rule is NOT triggered when it should be.
Milestone

Comments

@fmallet
Copy link
Contributor

fmallet commented May 18, 2017

RSPEC-2930 "IDisposable should be disposed" has artificial limitation to report issues only on certain classes, which should be removed.

Coming from SONARCS-840

@fmallet fmallet added the Type: False Negative Rule is NOT triggered when it should be. label May 18, 2017
@JasonBock
Copy link

This is a huge "miss" in my mind. I just tried using SonarAnalyzer.CSharp, and I was surprised that it missed an occurrence of this in my test code. Then I saw that it has the S2930 analyzer, but....it's limited to certain types? I'm curious, is it stated anywhere which types? And why is it limited?

@JasonBock
Copy link

OK, whoops, just noticed the link from @fmallet - https://jira.sonarsource.com/browse/RSPEC-2930. That's sad that the rule only works on a limited set of types. It should be broadened to any type implementing IDisposable.

@valhristov
Copy link
Contributor

@JasonBock thanks for the feedback! A couple of years ago the rule covered all types that implement IDisposable, but was changed to trigger only on specific types. I cannot find exactly why, but I guess it was because of too many raised false positives... We agree that the value of this rule is not very high in its current state, hence we have this ticket for improvement.

@michalb-sonar
Copy link
Contributor

@JasonBock The suggestion sounds very sensible. However, once implemented, this rule generates a lot of noise. That is particularly bad, because the reported issues are classified as blocker bugs, therefore our bar for quality is very high.
There are few cases where we could raise a code smell/minor bug, but at the moment there are no facilities for rule to raise items at different severity/clarification. That would require creating a separate rule, which we debated but rejected because it would be confusing and relatively low value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: False Negative Rule is NOT triggered when it should be.
Projects
None yet
Development

No branches or pull requests

4 participants