Unnecessary Code Detector

Recently I found a nice eclipse plugin for finding dead code. The standard eclipse check finds unused private fields and methods, only. You may use STRG+SHIFT+G for finding references to a public class or method in advance. But this approach is limited to search for methods/classes without references one by one, which is very time consuming. The UCDetector starts a search for methods and classses without any references to it in all projects in the current workspace respecting inheritance and presents the results in the ‘Problems’ view. The search is started manually from the context menu of a project, package or class and is time consuming (lean back, grab some coffee/tea). The results can be cleared afterwards, so that the entries do not pollute the problems view. You should enable ‘sort by type’ in order to distinguish the entries. Be careful when removing a method without any references, because it may have references outside your current workspace. This feature should be used for code parts that are cohered, only. If you are working on a project with many developers this tool may be very helpful in order to keep the code manageable.

Leave a Reply

Your email address will not be published. Required fields are marked *