static private bool Applicable (MethodDefinition method) { // rule doesn't apply to static ctor (called by the runtime) if (method.IsStatic && method.IsConstructor) return false; // don't consider the compiler generated add / remove on events if (((method.IsAddOn || method.IsRemoveOn) && method.IsSynchronized)) return false; // rule doesn't apply if the method is the assembly entry point or Main if (method.IsEntryPoint () || method.IsMain ()) return false; // rule doesn't apply if the method is generated by the compiler or by a tool if (method.IsGeneratedCode ()) return false; // does not apply if the method is used to register/unregister COM objects // or it is decorated with a [Conditional("x")] attribute if (method.HasCustomAttributes) { if (method.CustomAttributes.ContainsAnyType (SpecialAttributes)) return false; } return true; }