The requested page is not available for the requested platform. You are viewing the content for Default platform.

Redundant base qualifier

CodeRush Classic shows the Redundant base qualifier code issue if the base qualifier is redundant and can be removed.

Fix

Remove the redundant base qualifier.

Purpose

Highlights the base qualifiers, which can be removed to improve code readability.

Example

public class MyClassBase
{
    protected void ProcessString(string str)
    {
        Console.WriteLine(str);
    }
}
class MyClass: MyClassBase
{
    public MyClass(string name)
    {base.ProcessString(string.Format("{} created", name));
    }
    public string Name { get; private set; }
}

Fix:

public class MyClassBase
{
    protected void ProcessString(string str)
    {
        Console.WriteLine(str);
    }
}
class MyClass: MyClassBase
{
    public MyClass(string name)
    {
        ProcessString(string.Format("{} created", name));
    }
    public string Name { get; private set; }
}