开源工具来查找可达/未使用的C#代码 [英] Open source Tool to find unreachable/unused c# code

查看:185
本文介绍了开源工具来查找可达/未使用的C#代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何开源静态代码分析工具,可以帮助找到C#程序无法访问/未使用的代码?

is there any Open source static code analysis tool that can help to find unreachable /unused code in C# programs?

推荐答案

FxCop的,它内置在Visual Studio中的更高版本,将未使用的警告私有或内部成员。右键单击您的项目并选择运行代码分析。在接受无法访问的代码段一起被鉴定为其他人指出,这应该抓住剩余未使用的代码编译器。

FxCop, which is built into higher editions of Visual Studio, will warn of unused private or internal members. Right-click your project and choose Run Code Analysis. In conjunction with "unreachable code segments" being identified by the compiler as others have noted, this should catch the remaining unused code.

(注意的FxCop会的不是的警告未使用公共或受保护的成员,因为这些可能是专供外部调用者使用API​​的一部分。此外,FxCop的是不是在Visual Studio中,虽然老版本可供下载的所有版本提供。)

(Note FxCop will not warn of unused public or protected members, because these could be part of an API intended for use by external callers. Also, FxCop is not available in all editions of Visual Studio though older versions are available for download.)

这篇关于开源工具来查找可达/未使用的C#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆