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

Rule S4016: Enumeration members should not be named "Reserved" #351

Closed
valhristov opened this issue May 23, 2017 · 2 comments
Closed

Rule S4016: Enumeration members should not be named "Reserved" #351

valhristov opened this issue May 23, 2017 · 2 comments
Assignees
Milestone

Comments

@valhristov
Copy link
Contributor

RSPEC-4016

If an enum members name contains the word "reserved" it implies it is not currently used and will be change in the future. However changing an enum member is a breaking change and can create significant problems. There is no need to reserve an enum member since a new member can be added in the future, this, usually, will not be a breaking change.

@IhnatKlimchuk
Copy link

@valhristov I've faced with this warning as I have an enum with actual "Reserved" value, aka "Reserved room". I'm extremely impressed that it was covered here. Also suggest to add "NotReserved", "IDK", "Blah", "BlackList", "WhiteList", "Slave", "Master", "Communism", "Montenegro" to this list. Have a great day! =)

@nicolas-harraudeau-sonarsource

Hi @IhnatKlimchuk and thank you for your feedback.
We deprecated rule S4016 and specified S6061 instead which should avoid these kind of False Positives. There is no ETA as to when the new rule will be implemented. The old one will be removed from the default quality profile during the next release.

Next time could you please report False Positives, or any other suggestion, on our community forum? Thanks!

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

No branches or pull requests

5 participants