When to refactor code


#1
  • When we find duplication in our code. (Don’t forget the Rule of Three.) DRY violation.
  • When we break any object calisthenics rule.