【问题标题】:Exposing CQL Result in NDepend在 NDepend 中公开 CQL 结果
【发布时间】:2010-09-30 07:56:07
【问题描述】:


我在 NDepend 项目中有一些自定义 CQL,我想使用 NDepend.Console.exe 生成这些 CQL 的结果。生成报告时,我在报告中看不到自定义 CQL 的任何结果。我可以从 Visual NDepend 导出,但我想从脚本中使用 NDepend.Console.exe。 蚂蚁。

【问题讨论】:

  • 如果一切正常,您应该会看到您的自定义 CQL 输出。控制台运行器只不过是一个替代用户界面,它像 GUI 一样调用 NDepend 核心。没有不同。请更详细地写出你到底在做什么。

标签: ndepend cql cqlinq


【解决方案1】:

可以使用几种不同的方式在报告中显示代码查询和代码规则结果:

  • 您可以首先将您的代码查询转换为违反代码规则,例如,转换

    from m in Methods select new {m, m.CyclomaticComplexity}

    转入warnif count > 0 from m in Methods select new {m, m.CyclomaticComplexity}

    ...然后you need to set the following code query flag显示报告中选择的项目列表

  • 您也可以Reports groups of Code Queries in the report as explained here

  • 您可以使用NDepend.API以编程方式编译和执行代码查询或规则,并以编程方式浏览结果。请参阅 Power Tool Query Code with CQLinq 的源代码了解更多详情。 Power Tools的源代码可以在$NDependInstallPath$\NDepend.PowerTools.SourceCode\NDepend.PowerTools.sln

  • 中找到

【讨论】:

    猜你喜欢
    • 2010-09-11
    • 2010-10-07
    • 2011-07-15
    • 2010-09-23
    • 2011-01-15
    • 2012-04-25
    • 2015-01-01
    • 1970-01-01
    • 2011-01-28
    相关资源
    最近更新 更多