Rule S1172: Unused method parameters should be removed tries to detect the usage of method parameters. If we look the following example:
public class Compliant
{
private static long InlineUsage(int value) // FP, value is used by the inline function.
{
return Inline();
int Inline()
{
return Random.Shared.Next() > 42 ? value : 42;
}
}
}
It fails to detect the (conditional) usage of value in the Inline() method. Removing the conditional part (or making InlineUsage(int) public) resolves the issue.
Reported by SonarAnalyzer.CSharp v10.16.1.129956.