是否可以从 NDepend 分析中排除整个命名空间?
我有一个设置,其中 Visual Studio 2010 运行测试覆盖率分析,并且它的输出在集成构建期间被 NDepend 吸收。
一些程序集包含需要被 NDepend 忽略的生成代码。
有办法做到这一点吗?最好是整个命名空间。
I have a setup where Visual Studio 2010 runs test coverage analysis and it's output is absorbed by NDepend during an integration build.
A few assemblies contain generated code that needs to be ignored by NDepend.
Is there a way to do this? Preferably an entire namespace.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LINQ 上的代码查询和规则 (CQLinq) 确实提供了一种工具来忽略生成的代码。
有一个名为 JustMyCode 的方便的预定义域,其类型为 ICodeBaseView。
域 JustMyCode 表示 CQLinq 的一种工具,用于从 CQLinq 查询结果中消除生成的代码元素。例如,以下查询将仅匹配不是由工具(例如 UI 设计器)生成的大型方法:
生成的代码元素集由前缀为 CQLinq 关键字 notmycode 的 CQLinq 查询定义。例如,下面的查询匹配名称以 ".designer.cs" 结尾的源文件中定义的方法:
CQLinq 查询运行程序在依赖于 < 的查询之前执行所有 notmycode 查询。 strong>JustMyCode,因此域 JustMyCode 被一次性定义。显然,如果 notmycode 查询依赖于 JustMyCode 域,CQLinq 编译器会发出错误。
有 4 个默认的 notmycode 查询,可以轻松调整以满足您的需求。请注意,命名空间没有默认的 notmycode 查询,但您可以创建自己的查询:
Code Query and Rule over LINQ (CQLinq) indeed provides a facility to ignore generated code.
There is the convenient predefined domain named JustMyCode of type ICodeBaseView.
The domain JustMyCode represents a facility of CQLinq to eliminate generated code elements from CQLinq query results. For example the following query will only match large methods that are not generated by a tool (like a UI designer):
The set of generated code elements is defined by CQLinq queries prefixed with the CQLinq keyword notmycode. For example the query below matches methods defined in source files whose name ends up with ".designer.cs":
The CQLinq queries runner executes all notmycode queries before queries relying on JustMyCode, hence the domain JustMyCode is defined once for all. Obviously the CQLinq compiler emits an error if a notmycode query relies on the JustMyCode domain.
There are 4 default notmycode queries, easily adaptable to match your need. Notes that there is no default notmycode queries for namespaces but you can create your own one(s):
在“重构方法的快速摘要”中找到了这一点,
但这并不能解决修改每个 CQL 查询以确保它们都忽略生成的代码的需要。
Found this in the "Quick summary of methods to refactor"
But that doesn't address the need to modify every CQL query to ensure they all ignore the generated code.