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 S2187: Rule should not raise an issue when class is abstract #930

Merged
merged 2 commits into from
Nov 14, 2017

Conversation

Evangelink
Copy link
Contributor

@Evangelink Evangelink commented Nov 13, 2017

Fix #929

Copy link
Contributor

@michalb-sonar michalb-sonar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still report if abstract class with attribute has no derived classes.

if (classSymbol == null ||
!classSymbol.GetAttributes().Any(a => a.AttributeClass.IsAny(HandledTestClassAttributes)))
!classSymbol.GetAttributes().Any(a => a.AttributeClass.IsAny(HandledTestClassAttributes)) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move IsAbstract check before the attribute check. Hey, am I suggesting micro-performace tweak? :)

@Evangelink Evangelink merged commit 6f70b5e into master Nov 14, 2017
@Evangelink Evangelink deleted the ammo/fix-#929 branch November 14, 2017 10:09
@ghost ghost removed the Status: Needs Review label Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants