S1172 on Tupels

static void Main(string[] args)
{
    Console.WriteLine(add(1, 2));
}

static int add(int a, int b) // S1172: Remove this paramter 'a', whose value is ignored in the method.
{
    return add((a, b));
}

static int add((int, int) operands)
{
    return operands.Item1 + operands.Item2;
}

S1172 will be raised if a parameter is only used inside a tuple.

Hey there.

Looks like an already reported issue, SonarSource/sonar-dotnet #3255.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.