Separate deprecated classes

Issue #401 new
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

I want to know what code is connected to the application and which is vestigial so that I can navigate the code more effectively.

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

Try to determine whether a method or class is used in the current version of the code.

CURRENT BEHAVIOR

  1. Right-click on a method name and select References->Project or control-h and do a file search for method names
  2. At each instance where a method is found, return to step 1, but search for the method name in which the previous method was called.
  3. Once you've traveled up the hierarchy and find that no instances of the top method are called anywhere, you've determined that the method is not used.

EXPECTED BEHAVIOR

  1. If a method or class is no longer used, remove it so that we don't spend time trying to back-trace to determine whether it is used or not.

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

I suggest 1 of 2 possible options. When all calls to a method or inclusions of a class have been removed from active code:

  1. Delete that method or class.
  2. Move that method or class into a "deprecated" folder.

FILES AFFECTED (where the changes will be implemented) - developers only

unknown code SCMP

LEVEL OF EFFORT - developers only

major

COMMENTS

This is more of an issue with people who are not familiar with the code. If there's a more efficient way of determining whether a method is used or not in running code, please share in the comments.

I think that if a reason to keep code around is to possibly reuse it in the future, I submit that we can mine the history of the repository to retrieve it. Leaving it in the code base may be convenient, but it also contributes to bloat, so I would opt for suggestion 1: delete unused code from the code base.

Comments (5)

  1. Robert Leach reporter
    • removed milestone

    Removing milestone: Coding Convention Adherence (automated comment)

  2. Log in to comment