-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Performance.AvoidUninstantiatedInternalClassesRule(2.10)
Sebastien Pouliot edited this page Feb 9, 2011
·
3 revisions
Assembly: Gendarme.Rules.Performance
Version: 2.10
This rule will fire if a type is only visible within its assembly, can be instantiated, but is not instantiated. Such types are often leftover (dead code) or are debugging/testing code and not required. However in some case the types might by needed, e.g. when accessed thru reflection or if the InternalsVisibleTo attribute is used on the assembly.
Bad example:
// defined, but never instantiated
internal class MyInternalClass {
// ...
}
public class MyClass {
static void Main ()
{
// ...
}
}
Good example:
internal class MyInternalClass {
// ...
}
public class MyClass {
static void Main ()
{
MyInternalClass c = new MyInternalClass ();
// ...
}
}
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!