Reputation: 461
Is there a way or plugin to see if a method (get the list of methods) in the project that are not been used?
I can get the list of methods in the project by using this . But how to check if that method is being used in the project
Type.GetMethods()
Upvotes: 0
Views: 2605
Reputation: 25098
This is very hard to find in large project. But you can try several approaches.
Right click on the function -> find all references. These references could be also death code. So check for references for each. And again after you find out if it is really used or not.
Search the method name by text and check the occurrences. Repeat for callee if needed.
Another simple approach is put the breakpoint inside and run application and go throw scenarios. You hardly go throw all scenarios. But you can cover part of it.
Sometime it can be tricky if reflection is used. Such method could be called by reflection and you hardly find it out by reference search.
No approach is 100%. You can try any combination of them.
Upvotes: 1