C#

C#

By DeepSource

Method is empty and effectively does nothing CS-R1093

Anti-pattern
Autofix

A method that neither has any attributes nor participates in inheritance effectively does nothing and is redundant. Since such methods do not contribute anything of value to the codebase, consider removing such empty methods. Note that methods with user comments or pragmas are excluded from this issue.

Examples

Bad Practice

class C
{
    public void DoThis()
    {
    }
}

Recommended

class C
{
    public void DoThis(int i)
    {
        Console.WriteLine(i);
    }
}