| Conditions | 1 |
| Paths | 1 |
| Total Lines | 91 |
| Code Lines | 75 |
| 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_issue_efforts')->delete(); |
||
| 13 | |||
| 14 | \DB::table('config_issue_efforts')->insert(array( |
||
| 15 | 0 => array( |
||
| 16 | 'id' => 1, |
||
| 17 | 'title' => '0', |
||
| 18 | 'effort' => '0.00', |
||
| 19 | 'position' => 0, |
||
| 20 | 'enabled' => 1, |
||
| 21 | ), |
||
| 22 | 1 => array( |
||
| 23 | 'id' => 2, |
||
| 24 | 'title' => '1', |
||
| 25 | 'effort' => '1.00', |
||
| 26 | 'position' => 2, |
||
| 27 | 'enabled' => 1, |
||
| 28 | ), |
||
| 29 | 2 => array( |
||
| 30 | 'id' => 3, |
||
| 31 | 'title' => '2', |
||
| 32 | 'effort' => '2.00', |
||
| 33 | 'position' => 3, |
||
| 34 | 'enabled' => 1, |
||
| 35 | ), |
||
| 36 | 3 => array( |
||
| 37 | 'id' => 4, |
||
| 38 | 'title' => '3', |
||
| 39 | 'effort' => '3.00', |
||
| 40 | 'position' => 4, |
||
| 41 | 'enabled' => 1, |
||
| 42 | ), |
||
| 43 | 4 => array( |
||
| 44 | 'id' => 5, |
||
| 45 | 'title' => '5', |
||
| 46 | 'effort' => '5.00', |
||
| 47 | 'position' => 5, |
||
| 48 | 'enabled' => 1, |
||
| 49 | ), |
||
| 50 | 5 => array( |
||
| 51 | 'id' => 6, |
||
| 52 | 'title' => '8', |
||
| 53 | 'effort' => '8.00', |
||
| 54 | 'position' => 6, |
||
| 55 | 'enabled' => 1, |
||
| 56 | ), |
||
| 57 | 6 => array( |
||
| 58 | 'id' => 7, |
||
| 59 | 'title' => '13', |
||
| 60 | 'effort' => '13.00', |
||
| 61 | 'position' => 7, |
||
| 62 | 'enabled' => 1, |
||
| 63 | ), |
||
| 64 | 7 => array( |
||
| 65 | 'id' => 8, |
||
| 66 | 'title' => '21', |
||
| 67 | 'effort' => '21.00', |
||
| 68 | 'position' => 8, |
||
| 69 | 'enabled' => 1, |
||
| 70 | ), |
||
| 71 | 8 => array( |
||
| 72 | 'id' => 9, |
||
| 73 | 'title' => '34', |
||
| 74 | 'effort' => '34.00', |
||
| 75 | 'position' => 9, |
||
| 76 | 'enabled' => 1, |
||
| 77 | ), |
||
| 78 | 9 => array( |
||
| 79 | 'id' => 10, |
||
| 80 | 'title' => '55', |
||
| 81 | 'effort' => '55.00', |
||
| 82 | 'position' => 10, |
||
| 83 | 'enabled' => 1, |
||
| 84 | ), |
||
| 85 | 10 => array( |
||
| 86 | 'id' => 11, |
||
| 87 | 'title' => '89', |
||
| 88 | 'effort' => '89.00', |
||
| 89 | 'position' => 11, |
||
| 90 | 'enabled' => 1, |
||
| 91 | ), |
||
| 92 | 11 => array( |
||
| 93 | 'id' => 12, |
||
| 94 | 'title' => '1/2', |
||
| 95 | 'effort' => '0.50', |
||
| 96 | 'position' => 1, |
||
| 97 | 'enabled' => 1, |
||
| 98 | ), |
||
| 99 | )); |
||
| 100 | } |
||
| 101 | } |
||
| 102 |