如何自动化 Visual Studio 的代码指标功能
我想自动化在 .NET 解决方案上收集代码指标的过程。 有没有办法让msbuild运行VS2008开发版中包含的Code Metrics功能?
我可能最终会使用 SourceMonitor,但我想知道是否有办法使用来自命令行的 VS Code 指标引擎。
I want to automate the process of gathering code metrics on a .NET solution. Is there any way of getting msbuild to run the Code Metrics feature included in VS2008 Development Edition?
I may end up using SourceMonitor, but I would like to know if there is a way to use the VS code metrics engine from the command line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最后,微软为我们提供了 一种使用新的“电动工具"。
Finally, Microsoft have provided us with a way to automate the Visual Studio code metrics feature using a new "power tool".
这就是我的公司使用 MSBuild 自动化 FxCop 的方式:
然后,您可以编写一些 C# 代码来使用输出文件:
This is how my company has automated FxCop using MSBuild:
Then, you can write some C# code to consume the output file:
jgwood - 我相信他指的是代码度量(圈复杂度等)而不是 FxCop。 我也一直在寻找解决方案,因为 FxCop 的复杂性规则具有硬编码阈值。 听起来 VS2008 中还没有用于指标的命令行或 API(根据 代码分析团队博客上的这篇文章) - 希望他们会发布一个强大的工具。
您是否查看过 NDepend ?
jgwood - I believe he's referring to Code Metrics (cyclomatic complexity, etc.) and not FxCop. I have been looking for a solution for this as well, as the FxCop rule for complexity has hardcoded threshholds. It sounds like there's no command-line or API for the metrics in VS2008 yet (per this post on the Code Analysis Team Blog) - hopefully they'll release a powertool.
Have you looked at NDepend for this?