清理不需要的代码C# [英] Clean up unwanted code C#

查看:176
本文介绍了清理不需要的代码C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了与Visual Studio 2005 $ B $ C#应用程序B中的代码有一些300KLOC代码,这被强奸超过3年。

I got a C# application with Visual Studio 2005. The code has some 300KLOC code, which has been raped over 3 years.

当我要通过代码发现了大量未使用的函数/方法/属性。它不是可以手动(要求检查每个成员,如果没有发现任何引用删除。)

When I was going through code found out that lot of unused functions/methods/properties. Its not possible to clean the code manually (Requires checking each member and if found no references delete it.)

我希望通过VS宏,使该过程自动化,清洁码将通过在代码中的每个成员走路,如果没有它应该删除任何引用,如发现任何引用,检查其调用成员的引用,如果在调用成员,不具备任何参考应该同时删除等。

I am looking to automate this process, by VS macro, which will walk through each member in code, if it does not have any references it should delete it, if found any references, check its calling member's references if calling member, does not have any reference it should delete both and so on.

我相信有些人会更早破解它。

I am sure some one would have cracked it earlier.

推荐答案

<一个HREF =htt​​p://www.jetbrains.com/resharper/相对=nofollow> ReSharper的具有清洁码功能,并给出了非常好的迹象,其中未使用的方法/类。

Resharper has a Clean Code function and gives pretty good indication of which methods/classes aren't being used.

这篇关于清理不需要的代码C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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