I’ve made a mistake. The last few refactorings I’ve been doing to the Kanban plugin have been useful but they haven’t really been improving the design of the plugin. I thought about it yesterday and discovered that I was just swapping out bits of procedural code for more procedural code. Once I saw this, I …
Tag: redmine
Daily Refactor #48: Consolidate Duplicate Conditional Fragments in Kanban
The Refactoring In order to remove the duplication in Kanban#get_issues_for_pane, I need to first consolidate some of the duplication in each case statement. This refactoring pulls the ActiveRecord conditions out of the finder and into the ARCondition object. Before 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 …
Daily Refactor #47: Extract Method for Kanban panes – Part 3
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 …
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 …