-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Performance.AvoidUncalledPrivateCodeRule(2.10)
Sebastien Pouliot edited this page Jan 22, 2011
·
2 revisions
Assembly: Gendarme.Rules.Performance
Version: 2.10
This rule will check for internally visible methods which are never called. The rule will warn you if a private method isn't called in its declaring type or if an internal method doesn't have any callers in the assembly or isn't invoked by the runtime or a delegate.
Bad example:
public class MyClass {
private void MakeSuff ()
{
// ...
}
public void Method ()
{
Console.WriteLine ("Foo");
}
}
Good example (removing unused code):
public class MyClass {
public void Method ()
{
Console.WriteLine ("Foo");
}
}
Good example (use the code):
public class MyClass {
private void MakeSuff ()
{
// ...
}
public void Method ()
{
Console.WriteLine ("Foo");
MakeSuff ();
}
}
Note that this page was autogenerated (3/17/2011 9:31:58 PM) based on the xmldoc
comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!