函数级别的 Visual Studio 2010 代码指标

发布于 2024-09-24 13:16:51 字数 141 浏览 0 评论 0原文

我在我的一个项目上运行了代码指标计算,并且看到了项目中每个命名空间/类的结果。我想看到功能级别的结果。即使过滤器仍然在班级级别起作用。有什么办法可以做到这一点吗?例如,我想查看圈复杂度超过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蒲公英的约定 2024-10-01 13:16:51

您可以将结果导出到 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.

小兔几 2024-10-01 13:16:51

有点晚了,但我碰巧遇到了你的问题。我使用理解来做这件事,它对于检测圈复杂度或函数深度的任何问题非常强大:

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文