Title: Avoid unused parameters.
Description: The rule should ensure that all parameters in a method are
used.
Some methods will be skipped:
* Methods referenced by a delegate.
* Methods used as event handlers.
* Methods declared with the abstract modifier.
* Methods declared with the virtual modifier.
* Methods declared with the override modifier.
* Methods declared with the extern modifier.
References:
http://www.gotdotnet.com/Team/FxCop/Docs/Rules/Performance/AvoidUnusedParameters.html
Examples:
Good:
public void PrintBanner (Version version)
{
Console.WriteLine ("This is the foo program {0}", version);
}
Bad:
public void PrintBanner (Version version)
{
Console.WriteLine ("This is the foo program {0}",
Assembly.GetExecutingAssembly ().GetName ().Version);
}
Good:
public void PrintBanner ()
{
Console.WriteLine ("This is the foo program {0}",
Assembly.GetExecutingAssembly ().GetName ().Version);
}
I'm going to post the code for reviewing.
First, the test:
Second, the code:
That's all, comments are wellcome :)
Néstor.