| Checklist: |
|---|
| duplicate code |
| meaningful names |
| action in the right controller |
| variable scope - if used only within a method make it local |
| view - check for duplicate and see if partial can be used |
| is helper used as intended |
| how to avoid unnecessary routes |
| Meaningful Names: | ||
|---|---|---|
| Use Intention Revealing Names | elapsedTimeInDays, fileAgeInDays | |
| Avoid Disinformation | accountList | |
| Make Meaningfule Distinctions | moneyAmount->money, customerInfo->customer | |
| Use Pronounciable Names | genymdhms->generationTimeStamp | |
| Use Searchable Names | e | |
| Avoid Encodings | PhoneNumber phoneString=x,m_dsc | |
| Avoid Mental Mapping | r means url | |
| Class Names | Manager,Processor->Customer, WikiPage | |
| Method Names | postPayment, deletePage | |
| Don't be Cute | HoldhandGranada -> deleteItems | |
| Pick One Work Per Concept | fetch,retrieve,get->get | |
| Don't Pun | add | |
| Use Solution Domain Names | AccountVisitor | |
| Use Problem Domain Name | ||
| Add Meaningful Context | firstName->addrFirstName | |
| Method Rename: | ||
|---|---|---|
| check_logged_in | logged_in? | |
| receive_mail | sending_confirmation | |
| list_of_projects | index in project controller | |
| tools | iteration_board, project_iteration, iteration, view_iteration | |
| task_order | arrange_tasks, order_tasks, sort_tasks, prioritize_tasks | |
| done_task_min | show_minimun_done_task, minimize_done_tasks, hide_old_completed_task, show_latest_done_tasks | |
| moving_userstory_from_iteration_to_pb | move_to_product_backlog, move_from_iteration_to_product_backlog | |
| list_pb_userstories | show, show_product_backlog | |
| Code Duplication: | ||
|---|---|---|
| list_of_projects, assign_people_and_team | move this code to a private method and use filter for this method | |
| change_status_to_inprocess, change_status_to_done, change_status_to_todo | put this code in a single method and reuse it | |
| Improve Performance: | ||
|---|---|---|
| remove some methods from scrumboard controller | move those methods to their own controller | |
| remove unnecessary helpers | TasksHelper, ApplicationHelper,UserstoriesHelper | |
| task status is hard coded | instead of this hard coding use constants in model level | |
| instance variables | instead of this use local variables | |
| Avoid Disinformation: | ||
|---|---|---|
| avoid unnecessary variables and relationship mapping Eg:@iteration=@project.iterations | use this in view itself | |
| source: |
|---|
| http://blog.objectmentor.com/articles/2008/04/08/clean-code-whew |