I’ve decided to try something different with the next refactorings. Instead of working on a single section of code until it’s very well factored, I’m going to jump around a bit and tackle the sections that smell the worst. This will be good because I can work in different sections of Redmine and remove the …
Tag: refactoring
Daily Refactor #32: Inline Method in IssuesHelper#show_detail
I did this refactoring after yesterday’s but I wanted to do a separate post to clearly show how I got to the end result. The Refactoring The big duplication in #show_detail is in the case statement. Yesterday’s refactoring got it cleaned up enough so that seven cases where identical. So now refactoring the duplication is …
Daily Refactor #31: Extract Method in IssuesHelper#show_detail
The Refactoring The flay report on Caliper shows that IssuesHelper#show_detail has the most duplicated code in Redmine, specifically inside of a long case statement. The first step I took was to extract a new method from the body of the case statement. Before 1 2 3 4 5 6 7 8 9 10 11 12 …
Daily Refactor #30: Move Method into Issue
The Refactoring Today is the day that I finally get to finish the set of refactorings I started back on the 24th. My goal was to start converting the IssuesController into a skinny controller by moving code into the models. Today, I finally was able to cleanly move #issue_update from the controller into the Issue …
Daily Refactor #29: Replace Temp with Query in IssuesController#issue_update
The Refactoring I’m still hammering on #issue_update today. It’s almost to the point where I can move the entire method down into the Issue model but it’s creating too many instance variables that view needs. This refactoring moves one of those variables up into the higher level #edit and #update actions. Before 1 2 3 …