Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find "Dead code"

I am trying to find private methods that are not called from any other code (CA1811) https://msdn.microsoft.com/en-us/library/ms182264(v=vs.110).aspx, with Visual Studio 2012 Code Analysis buy it doesn't detect it, despite putting the project code analysis rule set in "all rules". This is possible? In this case, how can I configure my project solution? In case of installing any extension, I will prefer that it was free. Thanks!

like image 269
Rubén Aroca Avatar asked Dec 05 '22 00:12

Rubén Aroca


1 Answers

In case you are OK with a command line utility, I suggest the Resharper Command Line tool. It can do many great things that will help you, including finding dead code. It's free (Resharper VS extension is not) so it will get you going.

If Resharper can't find any dead code, maybe there's none and Code Analysis does work :-)

like image 179
Jan De Dobbeleer Avatar answered Dec 26 '22 12:12

Jan De Dobbeleer