org.sonar.plugins.csharp.S4225.html Maven / Gradle / Ivy
Why is this an issue?
Creating an extension method that extends object
is not recommended because it makes the method available on every type.
Extensions should be applied at the most specialized level possible, and that is very unlikely to be object
.
Noncompliant code example
public static class MyExtensions
{
public static void SomeExtension(this object obj) // Noncompliant
{
// ...
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy