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

S1186: also inspect empty set and init and empty local functions #3753

Closed
andrei-epure-sonarsource opened this issue Nov 16, 2020 · 0 comments · Fixed by #8584
Closed

S1186: also inspect empty set and init and empty local functions #3753

andrei-epure-sonarsource opened this issue Nov 16, 2020 · 0 comments · Fixed by #8584
Assignees
Labels
Sprint: Hardening Fix FPs/FNs/improvements
Milestone

Comments

@andrei-epure-sonarsource
Copy link
Contributor

andrei-epure-sonarsource commented Nov 16, 2020

Rule S1186 (EmptyMethod S1186) currently looks only at method bodies, and doesn't raise when seeing empty set or init (for C# 9).

It would make sense to raise on

  • empty set and init as these are actually void methods as well.
  • empy local functions

Remark: add and remove for events are both void, and empty method detection can be done for those too. A dedicated issue exists: #8599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sprint: Hardening Fix FPs/FNs/improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants