質問

Is it possible to find all the unused method in a solution?

I.e.

Private method not called inside the class or method which are called from methods which are not called

役に立ちましたか?

解決

You can use static code analysis for this task if you have access to a Visual Studio Pro (or above). The relevant rule is CA1811. Please note that this method gives you a good starting point but might report false positives, so you should be cautious when you remove methods.

See this link for an overview of static code analysis.

他のヒント

It's also possible to use NDepend following this article:

http://www.ndepend.com/DefaultRules/webframe.html?Q_Potentially_dead_Methods.html

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top