A method declaration contains an argument that is not used within the method. This should be addressed by removing the argument or implementing its use.
Arguments that are unused indicate either an incomplete implementation or a poorly planned out design. There are some situations where this is unavoidable, such as implementing delegates where event arguments are passed that may not be necessary in the implementation. This rule helps identify such issues and ignores the case of event arguments (identified by the method signature - first parameter is an argument and the second has a name that ends in "EventArgs". Because the unused argument may require implementation, violations of this rule cannot be automatically corrected.
[C#]
public int foo( string bar, int myFlag )
{
return bar.Length;
}
[C#]
public int foo2( string bar, int myFlag )
{
if ( myFlag == 1 )
if ( bar == null ) return 0;
return bar.Length;
}