函数级别的 Visual Studio 2010 代码指标
我在我的一个项目上运行了代码指标计算,并且看到了项目中每个命名空间/类的结果。我想看到功能级别的结果。即使过滤器仍然在班级级别起作用。有什么办法可以做到这一点吗?例如,我想查看圈复杂度超过 10 的任何函数,或者超过 20 行的函数。 谢谢!
-谢恩
I ran the code metrics calculation on a project of mine, and am seeing results for each namespace/class in the project. I'd like to see results at the function level. Even the filter still works at the class level. Is there any way to do this? For example, I want to see any functions where the cyclomatic complexity is over 10, or ones that have more than 20 lines.
Thanks!
-Shane
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将结果导出到 Excel。这可以通过单击代码指标结果窗口上的在 Microsoft Excel 中打开列表按钮来完成。在 Excel 电子表格中获得列表后,您可以仅筛选“成员”的“范围”列。这只会为您提供方法和属性。然后,您还可以从那里将其他列过滤为您想要的值(例如,循环复杂度 > 10)。这将产生您想要的结果。如果您了解 Excel 的使用方法,那么它在推理结果时会更加强大。
You can export the results to Excel. This can be done by clicking on the Open List in Microsoft Excel button on the Code Metrics Results window. Once you have the list in an Excel spreadsheet, you can filter the Scope column on Member only. This will get you only methods, and properties. Then from there you can also filter the other columns to the values you want (e.g. Cyclomatic Complexity > 10). This will produce the results that you want. Its quite a bit more powerful for reasoning about the results if you know your way around Excel.
有点晚了,但我碰巧遇到了你的问题。我使用理解来做这件事,它对于检测圈复杂度或函数深度的任何问题非常强大:
http://www.scitools.com/ scitools.com/
A bit late, but I just happened to run into your question. I use Understand for this stuff, it is really powerful to detect any problem with cyclomatic complexity or function depths:
http://www.scitools.com/