Rule S3125 advises us to not reuse names of methods/properties in nested classes. When the nested class implements a contract, either by an interface or base class, this is not an option, hence a FP.
using System;
public class Container
{
public static readonly object Do = new();
public static readonly object Other = new();
private sealed class PrivateImplementation : Base, IContract
{
public void Do() { } // Compliant, enforced by the interface
public override void Other() { } // Compliant, enforced by the interface
}
}
public interface IContract
{
void Do();
}
public abstract class Base
{
public abstract void Other();
}
Reported by SonarAnalyzer.CSharp v10.27.0.140913