Here is the third refactoring to clean up how the Kanban class gets it’s pane data. The Refactoring This refactoring is brutal to read through but it’s just moving the body of #get_incoming_issues, #get_backlog_issues, and #get_quick_issues into #get_issues_for_pane. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 …
Tag: extract-method
Daily Refactor #46: Extract Method for Kanban panes – Part 2
This is the second in a series of refactorings to clean up how the Kanban class gets it’s pane data. The Refactoring Using extract method again, I was able to merge #get_active and #get_testing so they both use a new method #issues_from_kanban_issue. Before 1 2 3 4 5 6 7 8 9 10 11 12 …
Daily Refactor #45: Extract Method for Kanban panes – Part 1
I’m starting on some major internal refactoring of the Kanban class now. There are seven core methods that it uses and they all contain a lot of copy and paste duplication. Today I’m starting on the Finished (#get_finished_issues) and Canceled (#get_canceled_issues) panes since they are almost mirror images. The Refactoring I used extract method with …
Daily Refactor #44: Extract Method in Kanban.
My StuffToDo plugin has now been improved and refactored quite a bit so it’s time to move onto a different plugin. Since I’m starting to do a lot of work in the Kanban plugin again, refactoring that plugin would be extremely useful. The Refactoring The first step I use when refactoring a new codebase is …
Daily Refactor #43: Extract Method in StuffToDoController
The Refactoring Today I used extract method to start cleaning up the new TimeGrid code I recently merged into the StuffToDo plugin. Before 1 2 3 4 5 # app/controllers/stuff_to_do_controller.rb class StuffToDoController "#{Issue.table_name}.id ASC") @time_entry = TimeEntry.new end end# app/controllers/stuff_to_do_controller.rb class StuffToDoController "#{Issue.table_name}.id ASC") @time_entry = TimeEntry.new end end After 1 2 3 4 5 …