我有一点 CQL:
// <Name>A stateless class or structure might be turned into a static type</Name>
warnif count > 0 (from t in Application.Types where
t.SizeOfInst ==0 &&
// For accuracy, this constraint doesn't take
// account of types that implement some interfaces.
// and classes that have a base class and don't
// derive directly from System.Object, or classes
// that have sub-classes children.
t.NbInterfacesImplemented == 0 &&
((t.IsClass && t.DepthOfInheritance == 1
&& t.NbChildren == 0)
|| t.IsStructure) &&
!t.IsStatic &&
!t.DeriveFrom("System.Attribute") &&
!t.IsAttributeClass &&
!t.IsGeneric && t.Name!="Program" && !(t.IsGeneratedByCompiler || t.HasAttribute(@"NDepend.CQL.NDependIgnoreAttribute") || t.HasAttribute("System.Runtime.CompilerServices.CompilerGeneratedAttribute".AllowNoMatch()))
select new { t, t.SizeOfInst, t.NbInterfacesImplemented,
t.DepthOfInheritance, t.NbChildren }).Take(10)
// this rule indicates stateless types that might
// eventually be turned into static classes.
// See the definition of the SizeOfInst metric here
// http://www.ndepend.com/Metrics.aspx#SizeOfInst
在 GUI 中很好,但是当我从命令行运行它时,我在输出报告中收到此消息:
1 query syntax error: Not a valid type name {"System.Attribute"}
知道为什么吗?