All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.plugins.csharp.S125.html Maven / Gradle / Ivy

There is a newer version: 10.5.0.109200
Show newest version

Why is this an issue?

Commented-out code distracts the focus from the actual executed code. It creates a noise that increases maintenance code. And because it is never executed, it quickly becomes out of date and invalid.

Commented-out code should be deleted and can be retrieved from source control history if required.

How to fix it

Delete the commented out code.

Code examples

Noncompliant code example

void Method(string s)
{
    // if (s.StartsWith('A'))
    // {
    //     s = s.Substring(1);
    // }

    // Do something...
}

Compliant solution

void Method(string s)
{
    // Do something...
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy