Refactoring Proposal 2 - Ottomoeller/ScavengrRefactoring GitHub Wiki

List of Refactorings

Refactoring 0:

Issue Being Addressed: Duplicate lines of code specified by Simian Reports.

Planned Refactoring:

Run Simian and git rid of the duplicate lines of code that have more than 3 duplicates. If we get all of those duplicates rid of try to git rid of all the duplicate lines of code.

Technical Difficulty:

This will be medium in the level of difficulty because getting rid of duplicate lines of code will require deeper understanding of multiple parts of this project. Though in some instances getting rid of duplicate lines will be straightforward there could be instances where the lines being changed are used in multiple places of the project and may require the deeper understanding as listed above.

Impact on the Code:

This will improve readability significantly. If we can get rid of duplicate lines and make smart naming schemes the code will be much easier to read.

Refactoring 1:

Issue Being Addressed: Check domain class variable names.

Planned Refactoring:

Go through each domain class and check each variable name making sure it relates to its' functionality. i.e. make sure there is no single letter variable names.

Technical Difficulty:

This should be low in difficulty level because the domain classes are not very large and finding unspecific variable names should be straightforward

Impact on the Code:

This will improve readability and cause less confusion when trying to sort out any logic in the code.

Refactoring 2:

Issue Being Addressed: Check controller class variable names.

Planned Refactoring:

Go through each controller class and check each variable name making sure it relates to its' functionality. i.e. make sure there is no single letter variable names.

Technical Difficulty:

This should be low in difficulty level because the controller classes are not very large and finding unspecific variable names should be straightforward

Impact on the Code:

This will improve readability and cause less confusion when trying to sort out any logic in the code.


Outcomes

Refactoring 0 - Duplicate lines of code specified by Simian Reports.

We were able to extract a few more methods in promptController, including redirectUnauthorized and promptNotFound. Most of the duplication that we found was complete 'if' statements that had just been re-used in multiple methods.

Refactoring 1 - Check domain class variable names.

We made minor changes to the Notification class variable names that did improve readability.

Refactoring 2 - Check controller class variable names.

We didn't find much here, but adding our helper methods did improve readability.