Conditions | 1 |
Paths | 1 |
Total Lines | 245 |
Code Lines | 217 |
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 |
||
14 | public function run() |
||
15 | { |
||
16 | \DB::table('states')->insert(array ( |
||
17 | 0 => |
||
18 | array ( |
||
19 | 'id' => '1', |
||
20 | 'title' => 'Acre', |
||
21 | 'letter' => 'AC', |
||
22 | 'iso' => '12', |
||
23 | 'slug' => 'acre', |
||
24 | 'population' => '816687', |
||
25 | ), |
||
26 | 1 => |
||
27 | array ( |
||
28 | 'id' => '2', |
||
29 | 'title' => 'Alagoas', |
||
30 | 'letter' => 'AL', |
||
31 | 'iso' => '27', |
||
32 | 'slug' => 'alagoas', |
||
33 | 'population' => '3358963', |
||
34 | ), |
||
35 | 2 => |
||
36 | array ( |
||
37 | 'id' => '3', |
||
38 | 'title' => 'Amazonas', |
||
39 | 'letter' => 'AM', |
||
40 | 'iso' => '13', |
||
41 | 'slug' => 'amazonas', |
||
42 | 'population' => '4001667', |
||
43 | ), |
||
44 | 3 => |
||
45 | array ( |
||
46 | 'id' => '4', |
||
47 | 'title' => 'Amapá', |
||
48 | 'letter' => 'AP', |
||
49 | 'iso' => '16', |
||
50 | 'slug' => 'amapa', |
||
51 | 'population' => '782295', |
||
52 | ), |
||
53 | 4 => |
||
54 | array ( |
||
55 | 'id' => '5', |
||
56 | 'title' => 'Bahia', |
||
57 | 'letter' => 'BA', |
||
58 | 'iso' => '29', |
||
59 | 'slug' => 'bahia', |
||
60 | 'population' => '15276566', |
||
61 | ), |
||
62 | 5 => |
||
63 | array ( |
||
64 | 'id' => '6', |
||
65 | 'title' => 'Ceará', |
||
66 | 'letter' => 'CE', |
||
67 | 'iso' => '23', |
||
68 | 'slug' => 'ceara', |
||
69 | 'population' => '8963663', |
||
70 | ), |
||
71 | 6 => |
||
72 | array ( |
||
73 | 'id' => '7', |
||
74 | 'title' => 'Distrito Federal', |
||
75 | 'letter' => 'DF', |
||
76 | 'iso' => '53', |
||
77 | 'slug' => 'distrito-federal', |
||
78 | 'population' => '2977216', |
||
79 | ), |
||
80 | 7 => |
||
81 | array ( |
||
82 | 'id' => '8', |
||
83 | 'title' => 'Espírito Santo', |
||
84 | 'letter' => 'ES', |
||
85 | 'iso' => '32', |
||
86 | 'slug' => 'espirito-santo', |
||
87 | 'population' => '3973697', |
||
88 | ), |
||
89 | 8 => |
||
90 | array ( |
||
91 | 'id' => '9', |
||
92 | 'title' => 'Goiás', |
||
93 | 'letter' => 'GO', |
||
94 | 'iso' => '52', |
||
95 | 'slug' => 'goias', |
||
96 | 'population' => '6695855', |
||
97 | ), |
||
98 | 9 => |
||
99 | array ( |
||
100 | 'id' => '10', |
||
101 | 'title' => 'Maranhão', |
||
102 | 'letter' => 'MA', |
||
103 | 'iso' => '21', |
||
104 | 'slug' => 'maranhao', |
||
105 | 'population' => '6954036', |
||
106 | ), |
||
107 | 10 => |
||
108 | array ( |
||
109 | 'id' => '11', |
||
110 | 'title' => 'Minas Gerais', |
||
111 | 'letter' => 'MG', |
||
112 | 'iso' => '31', |
||
113 | 'slug' => 'minas-gerais', |
||
114 | 'population' => '20997560', |
||
115 | ), |
||
116 | 11 => |
||
117 | array ( |
||
118 | 'id' => '12', |
||
119 | 'title' => 'Mato Grosso do Sul', |
||
120 | 'letter' => 'MS', |
||
121 | 'iso' => '50', |
||
122 | 'slug' => 'mato-grosso-do-sul', |
||
123 | 'population' => '2682386', |
||
124 | ), |
||
125 | 12 => |
||
126 | array ( |
||
127 | 'id' => '13', |
||
128 | 'title' => 'Mato Grosso', |
||
129 | 'letter' => 'MT', |
||
130 | 'iso' => '51', |
||
131 | 'slug' => 'mato-grosso', |
||
132 | 'population' => '3305531', |
||
133 | ), |
||
134 | 13 => |
||
135 | array ( |
||
136 | 'id' => '14', |
||
137 | 'title' => 'Pará', |
||
138 | 'letter' => 'PA', |
||
139 | 'iso' => '15', |
||
140 | 'slug' => 'para', |
||
141 | 'population' => '8272724', |
||
142 | ), |
||
143 | 14 => |
||
144 | array ( |
||
145 | 'id' => '15', |
||
146 | 'title' => 'Paraiba', |
||
147 | 'letter' => 'PB', |
||
148 | 'iso' => '25', |
||
149 | 'slug' => 'paraiba', |
||
150 | 'population' => '3999415', |
||
151 | ), |
||
152 | 15 => |
||
153 | array ( |
||
154 | 'id' => '16', |
||
155 | 'title' => 'Pernambuco', |
||
156 | 'letter' => 'PE', |
||
157 | 'iso' => '26', |
||
158 | 'slug' => 'pernambuco', |
||
159 | 'population' => '9410336', |
||
160 | ), |
||
161 | 16 => |
||
162 | array ( |
||
163 | 'id' => '17', |
||
164 | 'title' => 'Piauí', |
||
165 | 'letter' => 'PI', |
||
166 | 'iso' => '22', |
||
167 | 'slug' => 'piaui', |
||
168 | 'population' => '3212180', |
||
169 | ), |
||
170 | 17 => |
||
171 | array ( |
||
172 | 'id' => '18', |
||
173 | 'title' => 'Paraná', |
||
174 | 'letter' => 'PR', |
||
175 | 'iso' => '41', |
||
176 | 'slug' => 'parana', |
||
177 | 'population' => '11242720', |
||
178 | ), |
||
179 | 18 => |
||
180 | array ( |
||
181 | 'id' => '19', |
||
182 | 'title' => 'Rio de Janeiro', |
||
183 | 'letter' => 'RJ', |
||
184 | 'iso' => '33', |
||
185 | 'slug' => 'rio-de-janeiro', |
||
186 | 'population' => '16635996', |
||
187 | ), |
||
188 | 19 => |
||
189 | array ( |
||
190 | 'id' => '20', |
||
191 | 'title' => 'Rio Grande do Norte', |
||
192 | 'letter' => 'RN', |
||
193 | 'iso' => '24', |
||
194 | 'slug' => 'rio-grande-do-norte', |
||
195 | 'population' => '3474998', |
||
196 | ), |
||
197 | 20 => |
||
198 | array ( |
||
199 | 'id' => '21', |
||
200 | 'title' => 'Rondônia', |
||
201 | 'letter' => 'RO', |
||
202 | 'iso' => '11', |
||
203 | 'slug' => 'rondonia', |
||
204 | 'population' => '1787279', |
||
205 | ), |
||
206 | 21 => |
||
207 | array ( |
||
208 | 'id' => '22', |
||
209 | 'title' => 'Roraima', |
||
210 | 'letter' => 'RR', |
||
211 | 'iso' => '14', |
||
212 | 'slug' => 'roraima', |
||
213 | 'population' => '514229', |
||
214 | ), |
||
215 | 22 => |
||
216 | array ( |
||
217 | 'id' => '23', |
||
218 | 'title' => 'Rio Grande do Sul', |
||
219 | 'letter' => 'RS', |
||
220 | 'iso' => '43', |
||
221 | 'slug' => 'rio-grande-do-sul', |
||
222 | 'population' => '11286500', |
||
223 | ), |
||
224 | 23 => |
||
225 | array ( |
||
226 | 'id' => '24', |
||
227 | 'title' => 'Santa Catarina', |
||
228 | 'letter' => 'SC', |
||
229 | 'iso' => '42', |
||
230 | 'slug' => 'santa-catarina', |
||
231 | 'population' => '6910553', |
||
232 | ), |
||
233 | 24 => |
||
234 | array ( |
||
235 | 'id' => '25', |
||
236 | 'title' => 'Sergipe', |
||
237 | 'letter' => 'SE', |
||
238 | 'iso' => '28', |
||
239 | 'slug' => 'sergipe', |
||
240 | 'population' => '2265779', |
||
241 | ), |
||
242 | 25 => |
||
243 | array ( |
||
244 | 'id' => '26', |
||
245 | 'title' => 'São Paulo', |
||
246 | 'letter' => 'SP', |
||
247 | 'iso' => '35', |
||
248 | 'slug' => 'sao-paulo', |
||
249 | 'population' => '44749699', |
||
250 | ), |
||
251 | 26 => |
||
252 | array ( |
||
253 | 'id' => '27', |
||
254 | 'title' => 'Tocantins', |
||
255 | 'letter' => 'TO', |
||
256 | 'iso' => '17', |
||
257 | 'slug' => 'tocantins', |
||
258 | 'population' => '1532902', |
||
259 | ), |
||
263 |