Skip to content

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

@andrei-epure-sonarsource

Description

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions