Skip to content

Excess parameters in methods #44

@julianosaless

Description

@julianosaless

When the method has more than three parameters , suggesting a new class.

Before

public void MyMethod(string name,int age,string city,string neighborhood)
{
}

After:

public void MyMethod(NewClass address)
{
}

public class NewClass 
{
    public string Name {get;set;}
    //plus others for age, city, neighborhood
}

Category is Style.
Diagnostic id is CC0044.
This is essentially a refactoring so we will use a Hidden diagnostic.
@julianosaless is working on it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions