C#

C#

Made by DeepSource

static field is hidden due to method's parameter CS-W1085

Bug risk
Critical

static fields are those fields that can be accessed without a class instance. If a method has a parameter whose identifier is the same as that of a static field, then the respective static field becomes hidden and is no longer accessible within the method. It is therefore recommended that you rename the parameter.

Bad Practice

static int i = 0;

public void M(int i) // Hides field `i`
{
    // ...
}

Recommended

static int i = 0;

public void M(int j) // Renamed to `j`
{
    // ...
}