Search all methods without reference Visual Studio

2

How to search all methods without reference in Visual Studio, ie methods that are not being used, I know that when I click on a method with the right button and and choose "Find All References" it shows the references, how to do for all of the solution ?

    
asked by anonymous 29.09.2015 / 13:34

1 answer

3

In the Visual Studio default there is no way to. But there are utilities to install on it that can help.

In FXCop there are some rules that detect this, especially the

  

Private methods that are not called from any other code (CA1811)

It does not solve everything, but it does the most obvious thing. If you have something public that was not used you need to think about why it was not used. Maybe it could be one day. I would not leave filing these methods so easily. Much less use them just to have use.

Resharper can search the entire solution. In the solution search for Find Code Issues and then Unused Symbols . Go get not only unused methods.

You can also go in ReSharper = > Inspect = > Codes Issues Then it goes in Filter Issues and there select Redundancy in Symbol Ddeclaration = > type or type member is never use .

You also have NDepend . You have to create a query. You have example on the site .

    
29.09.2015 / 13:49