Examples:
1) public class UncalledPrivateMethod
{
private void method ()
{
}
public static void Main ()
{
}
}
This is bad. Compiler also raises warning for this case, but my
code will also flag an error for it.
2) internal class UncalledPublicMethodInInternalClass
{
public void method ()
{
}
}
This is bad.
3) class UncalledPublicMethodInPrivateClass
{
private class PrivateClass
{
public void method ()
{
}
}
}
This is bad.
These are just few examples. I'll add more test-cases to
AvoidUncalledPrivateCodeTest.cs
Link for the rule is:
http://mono-soc-2007.googlecode.com/svn/trunk/nidhi/rules/Gendarme.Rules.Performance/AvoidUncalledPrivateCodeRule.cs
Link for test-cases is:
http://mono-soc-2007.googlecode.com/svn/trunk/nidhi/rules/Gendarme.Rules.Performance/Test/AvoidUncalledPrivateCodeTest.cs
> References:http://blogs.msdn.com/fxcop/archive/2007/08/09/what-rules-do-microsof...