如何在Visual Studio 2013中删除未使用的函数 [英] How to remove unused functions in Visual Studio 2013

查看:672
本文介绍了如何在Visual Studio 2013中删除未使用的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问的Visual Studio 2013有设施显示未使用的功能呢?

Does Visual Studio 2013 have facility for showing unused functions?

最好的解决办法是什么除去那些功能?

What is the best solution to removing those functions?

推荐答案

ReSharper的可以检测和亮点当启用解决方案范围的分析,死者code。

ReSharper can detect and highlight dead code when solution-wide analysis is enabled.

这将报告一些误报,所以人工审核还是需要的。例如,R#将不检测,当函数只使用通过反射,并会考虑它不使用。这同样适用于像基于公约等国际奥委会的容器。

It will report some false positives, so a manual review is still needed. For instance, R# won't detect when a function is used only through reflection, and will consider it's not used. The same goes for things like IoC containers based on conventions etc.

JetBrains公司提供了一些自定义属性与(如 [UsedImplicitly] )装饰你的code。他们引导R·分析引擎和记录code。

JetBrains provides some custom attributes to decorate your code with (like [UsedImplicitly]). They guide the R# analysis engine and document your code.

这篇关于如何在Visual Studio 2013中删除未使用的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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