You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that this rule should take method overloads into account.
internalclassProgram{internalstaticvoidDoSomething(objectinput){switch(input){caseintvalue:Do(value);break;casestringvalue:Do(value);// GCop415 The same code is repeated in multiple IF branches. Instead update the IF condition to cover both scenarios.break;caseDateTimevalue:Do(value);// GCop415 The same code is repeated in multiple IF branches. Instead update the IF condition to cover both scenarios.break;default:thrownewNotImplementedException();}}privatestaticvoidDo(intvalue){Console.Write(value+1);}privatestaticvoidDo(stringvalue){Console.WriteLine(value.Substring(1,4));}privatestaticvoidDo(DateTimevalue){Console.WriteLine(value.AddDays(2));}}
The text was updated successfully, but these errors were encountered:
It seems to me that this rule should take method overloads into account.
The text was updated successfully, but these errors were encountered: