Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use ReSharper to list unused methods in a solution? [duplicate]

In a legacy ASP.NET project I have inherited, there are an abundance of methods defined which are used absolutely nowhere.

I'm familiar with the "Find usages" functionality, but would like to be able to generate a list of methods which are not called anywhere in the app. Does such functionality exist?

like image 302
Micheal Wells Avatar asked Mar 28 '13 21:03

Micheal Wells


People also ask

How do I find unused methods in C#?

Right click on your solution and selection "Find Code Issues". One of the results is "Unused Symbols". This will show you classes, methods, etc., that aren't used.

Where is the unused code in Visual Studio?

To find unused members with a Code Analysis Ruleset, from the Visual Studio menu select File -> New -> File… -> General -> Code Analysis Rule Set. Uncheck all the rules. There are many rules we don't care about right now – and some we probably won't ever care about.

How do I see unused methods in IntelliJ?

In newer versions of IntelliJ it's under Code -> Analyze Code -> Run Inspection by Name. Show activity on this post.


1 Answers

You can select ReSharper => Inspect => Codes Issues in solution ; And there, you can group by "Issue Type" and you should see all issues that match with "Type or type member is never used" (unused method goes there)

(And if you click right on it, you can select : "Show only "type or type member is never used" issues" .. and there you go ;)

ReSharper[1]

like image 155
Gauthier G. Letellier Avatar answered Oct 06 '22 11:10

Gauthier G. Letellier