您可以这样修改 CQLinq 规则主体:
// <Name>Methods with too many parameters</Name>
warnif count > 0 from m in JustMyCode.Methods
.WithFullNameNotIn("MyNamespace.MyType.MyMethod1(String,Int32,Int32,Boolean,String,Int32,Int32,Boolean,String,Int32,Int32,Boolean)",
"MyNamespace.MyType.MyMethod2(String,Int32,Int32,Boolean,String,Int32,Int32,Boolean,String,Int32,Int32,Boolean)",
...)
where
m.NbParameters > 5
orderby m.NbParameters descending
select new { m, m.NbParameters }
请注意,规则主体包含排除方法全名。要获取方法全名,只需右键单击结果中的方法并选择菜单将名称复制到剪贴板.
或者,如果您希望从所有规则结果中抑制某个方法,您可以使用JustMyCode/notmycode 设施 http://www.ndepend.com/Doc_CQLinq_Syntax.aspx#NotMyCode.