开发者

Visual Studio 2010 Code Metrics at Function Level

开发者 https://www.devze.com 2023-01-16 21:51 出处:网络
I ran the code metrics calculation on a project of mine, and am seeing results for each namespace/class in the project.I\'d开发者_StackOverflow中文版 like to see results at the function level.Even the

I ran the code metrics calculation on a project of mine, and am seeing results for each namespace/class in the project. I'd开发者_StackOverflow中文版 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


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.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号