Menu

#8 Server4

1.0
closed
None
2016-03-30
2016-03-29
No

As both Run methods were similar, the refactor extract superclass was used again so that we could increase the understandibility and reduce the code in only one class, the same refactor was needed to be used in the 4 code smells because this we found out the this was a big issue and we could improve this 4 issues in only one class.
Both run methods were based on the same logic:
if(filterCondition)
positivePositive();
else
negativeHandling();
We opted to make these methods abstract for other filter classes to implement their desired conditions and respective handling.

Code Smell: Duplicated Code
Classes: CurseWordFilter and AdvertiseFilterThread
Methods: Run (both)
Refactoring: Extract Superclass

Discussion

  • Ana Sara Neves Morais

     
  • Nicole Oliveira Rita

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -6,7 +6,6 @@
         negativeHandling();
     We opted to make these methods abstract for other filter classes to implement their desired conditions and respective handling.
    
    -
     Code Smell: Duplicated Code
     Classes: CurseWordFilter and AdvertiseFilterThread
     Methods: Run (both)
    
    • status: open --> closed
     

Log in to post a comment.