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

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

There is a newer version: 10.2.0.105762
Show newest version

Why is this an issue?

Type parameters that aren’t used are dead code, which can only distract and possibly confuse developers during maintenance. Therefore, unused type parameters should be removed.

Noncompliant code example

public class MoreMath<T>   // Noncompliant; <T> is ignored
{
  public int Add<T>(int a, int b) // Noncompliant; <T> is ignored
  {
    return a + b;
  }
}

Compliant solution

public class MoreMath
{
  public int Add (int a, int b)
  {
    return a + b;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy