| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 183 | 
| Code Lines | 153 | 
| 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  | 
            ||
| 11 | public function run(): void  | 
            ||
| 12 |     { | 
            ||
| 13 | //Action when run the seed  | 
            ||
| 14 | |||
| 15 | $data = [  | 
            ||
| 16 | 0 => [  | 
            ||
| 17 | 'id' => 1,  | 
            ||
| 18 | 'code' => 'permission_list',  | 
            ||
| 19 | 'description' => 'View permissions',  | 
            ||
| 20 | 'created_at' => '2023-12-06 00:21:14',  | 
            ||
| 21 | 'updated_at' => NULL,  | 
            ||
| 22 | ],  | 
            ||
| 23 | 1 => [  | 
            ||
| 24 | 'id' => 2,  | 
            ||
| 25 | 'code' => 'permission_create',  | 
            ||
| 26 | 'description' => 'Create permission',  | 
            ||
| 27 | 'created_at' => '2023-12-06 00:38:47',  | 
            ||
| 28 | 'updated_at' => NULL,  | 
            ||
| 29 | ],  | 
            ||
| 30 | 2 => [  | 
            ||
| 31 | 'id' => 3,  | 
            ||
| 32 | 'code' => 'permission_detail',  | 
            ||
| 33 | 'description' => 'View detail permission',  | 
            ||
| 34 | 'created_at' => '2023-12-06 00:39:33',  | 
            ||
| 35 | 'updated_at' => NULL,  | 
            ||
| 36 | ],  | 
            ||
| 37 | 3 => [  | 
            ||
| 38 | 'id' => 4,  | 
            ||
| 39 | 'code' => 'permission_update',  | 
            ||
| 40 | 'description' => 'Edit permission',  | 
            ||
| 41 | 'created_at' => '2023-12-06 00:39:54',  | 
            ||
| 42 | 'updated_at' => NULL,  | 
            ||
| 43 | ],  | 
            ||
| 44 | 4 => [  | 
            ||
| 45 | 'id' => 5,  | 
            ||
| 46 | 'code' => 'permission_delete',  | 
            ||
| 47 | 'description' => 'Delete permission',  | 
            ||
| 48 | 'created_at' => '2023-12-06 00:40:11',  | 
            ||
| 49 | 'updated_at' => '2023-12-06 00:46:18',  | 
            ||
| 50 | ],  | 
            ||
| 51 | 5 => [  | 
            ||
| 52 | 'id' => 6,  | 
            ||
| 53 | 'code' => 'role_list',  | 
            ||
| 54 | 'description' => 'View roles',  | 
            ||
| 55 | 'created_at' => '2023-12-06 00:21:14',  | 
            ||
| 56 | 'updated_at' => NULL,  | 
            ||
| 57 | ],  | 
            ||
| 58 | 6 => [  | 
            ||
| 59 | 'id' => 7,  | 
            ||
| 60 | 'code' => 'role_create',  | 
            ||
| 61 | 'description' => 'Create role',  | 
            ||
| 62 | 'created_at' => '2023-12-06 00:38:47',  | 
            ||
| 63 | 'updated_at' => NULL,  | 
            ||
| 64 | ],  | 
            ||
| 65 | 7 => [  | 
            ||
| 66 | 'id' => 8,  | 
            ||
| 67 | 'code' => 'role_detail',  | 
            ||
| 68 | 'description' => 'View detail role',  | 
            ||
| 69 | 'created_at' => '2023-12-06 00:39:33',  | 
            ||
| 70 | 'updated_at' => NULL,  | 
            ||
| 71 | ],  | 
            ||
| 72 | 8 => [  | 
            ||
| 73 | 'id' => 9,  | 
            ||
| 74 | 'code' => 'role_update',  | 
            ||
| 75 | 'description' => 'Edit role',  | 
            ||
| 76 | 'created_at' => '2023-12-06 00:39:54',  | 
            ||
| 77 | 'updated_at' => NULL,  | 
            ||
| 78 | ],  | 
            ||
| 79 | 9 => [  | 
            ||
| 80 | 'id' => 10,  | 
            ||
| 81 | 'code' => 'role_delete',  | 
            ||
| 82 | 'description' => 'Delete role',  | 
            ||
| 83 | 'created_at' => '2023-12-06 00:40:11',  | 
            ||
| 84 | 'updated_at' => '2023-12-06 00:46:18',  | 
            ||
| 85 | ],  | 
            ||
| 86 | 10 => [  | 
            ||
| 87 | 'id' => 11,  | 
            ||
| 88 | 'code' => 'user_list',  | 
            ||
| 89 | 'description' => 'View users',  | 
            ||
| 90 | 'created_at' => '2023-12-06 00:21:14',  | 
            ||
| 91 | 'updated_at' => NULL,  | 
            ||
| 92 | ],  | 
            ||
| 93 | 11 => [  | 
            ||
| 94 | 'id' => 12,  | 
            ||
| 95 | 'code' => 'user_create',  | 
            ||
| 96 | 'description' => 'Create user',  | 
            ||
| 97 | 'created_at' => '2023-12-06 00:38:47',  | 
            ||
| 98 | 'updated_at' => NULL,  | 
            ||
| 99 | ],  | 
            ||
| 100 | 12 => [  | 
            ||
| 101 | 'id' => 13,  | 
            ||
| 102 | 'code' => 'user_detail',  | 
            ||
| 103 | 'description' => 'View detail user',  | 
            ||
| 104 | 'created_at' => '2023-12-06 00:39:33',  | 
            ||
| 105 | 'updated_at' => NULL,  | 
            ||
| 106 | ],  | 
            ||
| 107 | 13 => [  | 
            ||
| 108 | 'id' => 14,  | 
            ||
| 109 | 'code' => 'user_update',  | 
            ||
| 110 | 'description' => 'Edit user',  | 
            ||
| 111 | 'created_at' => '2023-12-06 00:39:54',  | 
            ||
| 112 | 'updated_at' => NULL,  | 
            ||
| 113 | ],  | 
            ||
| 114 | 14 => [  | 
            ||
| 115 | 'id' => 15,  | 
            ||
| 116 | 'code' => 'user_delete',  | 
            ||
| 117 | 'description' => 'Delete user',  | 
            ||
| 118 | 'created_at' => '2023-12-06 00:40:11',  | 
            ||
| 119 | 'updated_at' => '2023-12-06 00:46:18',  | 
            ||
| 120 | ],  | 
            ||
| 121 | 15 => [  | 
            ||
| 122 | 'id' => 16,  | 
            ||
| 123 | 'code' => 'product_category_list',  | 
            ||
| 124 | 'description' => 'View product categories',  | 
            ||
| 125 | 'created_at' => '2023-12-06 00:21:14',  | 
            ||
| 126 | 'updated_at' => NULL,  | 
            ||
| 127 | ],  | 
            ||
| 128 | 16 => [  | 
            ||
| 129 | 'id' => 17,  | 
            ||
| 130 | 'code' => 'product_category_create',  | 
            ||
| 131 | 'description' => 'Create product category',  | 
            ||
| 132 | 'created_at' => '2023-12-06 00:38:47',  | 
            ||
| 133 | 'updated_at' => NULL,  | 
            ||
| 134 | ],  | 
            ||
| 135 | 17 => [  | 
            ||
| 136 | 'id' => 18,  | 
            ||
| 137 | 'code' => 'product_category_detail',  | 
            ||
| 138 | 'description' => 'View detail product category',  | 
            ||
| 139 | 'created_at' => '2023-12-06 00:39:33',  | 
            ||
| 140 | 'updated_at' => NULL,  | 
            ||
| 141 | ],  | 
            ||
| 142 | 18 => [  | 
            ||
| 143 | 'id' => 19,  | 
            ||
| 144 | 'code' => 'product_category_update',  | 
            ||
| 145 | 'description' => 'Edit product category',  | 
            ||
| 146 | 'created_at' => '2023-12-06 00:39:54',  | 
            ||
| 147 | 'updated_at' => NULL,  | 
            ||
| 148 | ],  | 
            ||
| 149 | 19 => [  | 
            ||
| 150 | 'id' => 20,  | 
            ||
| 151 | 'code' => 'product_category_delete',  | 
            ||
| 152 | 'description' => 'Delete product category',  | 
            ||
| 153 | 'created_at' => '2023-12-06 00:40:11',  | 
            ||
| 154 | 'updated_at' => '2023-12-06 00:46:18',  | 
            ||
| 155 | ],  | 
            ||
| 156 | 20 => [  | 
            ||
| 157 | 'id' => 21,  | 
            ||
| 158 | 'code' => 'product_list',  | 
            ||
| 159 | 'description' => 'View products',  | 
            ||
| 160 | 'created_at' => '2023-12-06 00:21:14',  | 
            ||
| 161 | 'updated_at' => NULL,  | 
            ||
| 162 | ],  | 
            ||
| 163 | 21 => [  | 
            ||
| 164 | 'id' => 22,  | 
            ||
| 165 | 'code' => 'product_create',  | 
            ||
| 166 | 'description' => 'Create product',  | 
            ||
| 167 | 'created_at' => '2023-12-06 00:38:47',  | 
            ||
| 168 | 'updated_at' => NULL,  | 
            ||
| 169 | ],  | 
            ||
| 170 | 22 => [  | 
            ||
| 171 | 'id' => 23,  | 
            ||
| 172 | 'code' => 'product_detail',  | 
            ||
| 173 | 'description' => 'View detail product',  | 
            ||
| 174 | 'created_at' => '2023-12-06 00:39:33',  | 
            ||
| 175 | 'updated_at' => NULL,  | 
            ||
| 176 | ],  | 
            ||
| 177 | 23 => [  | 
            ||
| 178 | 'id' => 24,  | 
            ||
| 179 | 'code' => 'product_update',  | 
            ||
| 180 | 'description' => 'Edit product',  | 
            ||
| 181 | 'created_at' => '2023-12-06 00:39:54',  | 
            ||
| 182 | 'updated_at' => NULL,  | 
            ||
| 183 | ],  | 
            ||
| 184 | 24 => [  | 
            ||
| 185 | 'id' => 25,  | 
            ||
| 186 | 'code' => 'product_delete',  | 
            ||
| 187 | 'description' => 'Delete product',  | 
            ||
| 188 | 'created_at' => '2023-12-06 00:40:11',  | 
            ||
| 189 | 'updated_at' => '2023-12-06 00:46:18',  | 
            ||
| 190 | ],  | 
            ||
| 191 | ];  | 
            ||
| 192 |         foreach ($data as $row) { | 
            ||
| 193 |             $this->insert($row)->into('permissions'); | 
            ||
| 194 | }  | 
            ||
| 197 | }  |