| Conditions | 1 |
| Paths | 1 |
| Total Lines | 97 |
| Code Lines | 84 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 10 | public function run() |
||
| 11 | { |
||
| 12 | \DB::table('config_statuses')->delete(); |
||
| 13 | |||
| 14 | \DB::table('config_statuses')->insert(array( |
||
| 15 | 0 => array( |
||
| 16 | 'id' => 1, |
||
| 17 | 'slug' => 'todo', |
||
| 18 | 'type' => 'issue', |
||
| 19 | 'title' => 'Todo', |
||
| 20 | 'position' => 1, |
||
| 21 | 'color' => 'daa724', |
||
| 22 | 'is_closed' => null, |
||
| 23 | 'default' => 1, |
||
| 24 | ), |
||
| 25 | 1 => array( |
||
| 26 | 'id' => 2, |
||
| 27 | 'slug' => 'in-progress', |
||
| 28 | 'type' => 'issue', |
||
| 29 | 'title' => 'In Progress', |
||
| 30 | 'position' => 2, |
||
| 31 | 'color' => '079a0d', |
||
| 32 | 'is_closed' => null, |
||
| 33 | 'default' => null, |
||
| 34 | ), |
||
| 35 | 2 => array( |
||
| 36 | 'id' => 3, |
||
| 37 | 'slug' => 'done', |
||
| 38 | 'type' => 'issue', |
||
| 39 | 'title' => 'Done', |
||
| 40 | 'position' => 3, |
||
| 41 | 'color' => '3745be', |
||
| 42 | 'is_closed' => 1, |
||
| 43 | 'default' => null, |
||
| 44 | ), |
||
| 45 | 3 => array( |
||
| 46 | 'id' => 4, |
||
| 47 | 'slug' => 'archived', |
||
| 48 | 'type' => 'issue', |
||
| 49 | 'title' => 'Arquived', |
||
| 50 | 'position' => 4, |
||
| 51 | 'color' => '8c023f', |
||
| 52 | 'is_closed' => 1, |
||
| 53 | 'default' => null, |
||
| 54 | ), |
||
| 55 | 4 => array( |
||
| 56 | 'id' => 5, |
||
| 57 | 'slug' => 'updated', |
||
| 58 | 'type' => 'note', |
||
| 59 | 'title' => 'Updated', |
||
| 60 | 'position' => 0, |
||
| 61 | 'color' => 'f0f0f0', |
||
| 62 | 'is_closed' => null, |
||
| 63 | 'default' => 1, |
||
| 64 | ), |
||
| 65 | 5 => array( |
||
| 66 | 'id' => 6, |
||
| 67 | 'slug' => 'open', |
||
| 68 | 'type' => 'sprint', |
||
| 69 | 'title' => 'Open', |
||
| 70 | 'position' => 1, |
||
| 71 | 'color' => '079a0d', |
||
| 72 | 'is_closed' => null, |
||
| 73 | 'default' => 1, |
||
| 74 | ), |
||
| 75 | 6 => array( |
||
| 76 | 'id' => 7, |
||
| 77 | 'slug' => 'closed', |
||
| 78 | 'type' => 'sprint', |
||
| 79 | 'title' => 'Closed', |
||
| 80 | 'position' => 3, |
||
| 81 | 'color' => '3745be', |
||
| 82 | 'is_closed' => 1, |
||
| 83 | 'default' => null, |
||
| 84 | ), |
||
| 85 | 7 => array( |
||
| 86 | 'id' => 8, |
||
| 87 | 'slug' => 'standby', |
||
| 88 | 'type' => 'sprint', |
||
| 89 | 'title' => 'Standby', |
||
| 90 | 'position' => 2, |
||
| 91 | 'color' => '8c023f', |
||
| 92 | 'is_closed' => null, |
||
| 93 | 'default' => null, |
||
| 94 | ), |
||
| 95 | 8 => array( |
||
| 96 | 'id' => 8, |
||
| 97 | 'slug' => 'attachment-added', |
||
| 98 | 'type' => 'attachment', |
||
| 99 | 'title' => 'Added', |
||
| 100 | 'position' => 1, |
||
| 101 | 'color' => '6272a4', |
||
| 102 | 'is_closed' => null, |
||
| 103 | 'default' => null, |
||
| 104 | ), |
||
| 105 | )); |
||
| 106 | } |
||
| 107 | } |
||
| 108 |