Conditions | 1 |
Paths | 1 |
Total Lines | 52 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 6 | ||
Bugs | 0 | Features | 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 |
||
48 | public function provideSimplify() |
||
49 | { |
||
50 | return [ |
||
51 | [ |
||
52 | // .com.au |
||
53 | 'https://books.google.com.au/books?id=QHrQoDLNBUIC&pg=PT19&lpg=PT19&dq=Iotape+of+Commagene&source=web&ots=aZ3hKg3uDr&sig=Y_zdZhNP-qNZE6WIDNivPPm-Urg&hl=en&sa=X&oi=book_result&resnum=8&ct=result', |
||
54 | 'https://books.google.com.au/books?id=QHrQoDLNBUIC&pg=PT19&dq=Iotape+of+Commagene', |
||
55 | ], |
||
56 | [ |
||
57 | // 'id' in the middle |
||
58 | 'https://books.google.fr/books?hl=fr&id=CWkrAQAAMAAJ&dq=La+dur%C3%A9e+d%27ensoleillement+n%27est+pas+suffisante+en+Afrique&focus=searchwithinvolume&q=ceintures', |
||
59 | 'https://books.google.fr/books?id=CWkrAQAAMAAJ&q=ceintures', |
||
60 | ], |
||
61 | [ |
||
62 | // strange format |
||
63 | 'https://books.google.fr/books/about/Kate_Bush.html?id=YL0EDgAAQBAJ&printsec=frontcover&source=kp_read_button&redir_esc=y#v=onepage&q&f=false', |
||
64 | 'https://books.google.fr/books?id=YL0EDgAAQBAJ&printsec=frontcover', |
||
65 | ], |
||
66 | [ |
||
67 | // Maroc : sous-domaine .co.ma |
||
68 | 'https://books.google.co.ma/books?id=26gcP_Yz-i8C&PG=PA56', |
||
69 | 'https://books.google.co.ma/books?id=26gcP_Yz-i8C&pg=PA56', |
||
70 | ], |
||
71 | [ |
||
72 | // uppercase "ID=" |
||
73 | 'https://books.google.fr/books?ID=26gcP_Yz-i8C&PG=PA56', |
||
74 | 'https://books.google.fr/books?id=26gcP_Yz-i8C&pg=PA56', |
||
75 | ], |
||
76 | [ |
||
77 | // common pattern |
||
78 | 'https://books.google.fr/books?id=26gcP_Yz-i8C&pg=PA56&lpg=PA56&dq=André+Poznanski&source=bl&ots=tuFKKbkpUS&sig=ACfU3U058ij4qQHFsXX_KX01YK81SLCCBw&hl=fr&sa=X&ved=2ahUKEwiB6tHVtKbkAhULNRoKHbOeDXU4ChDoATAAegQICBAB#v=onepage&q=André%20Poznanski&f=false', |
||
79 | 'https://books.google.fr/books?id=26gcP_Yz-i8C&pg=PA56&dq=Andr%C3%A9+Poznanski' |
||
80 | ], |
||
81 | [ |
||
82 | // pattern 'http://' and '/books/reader' |
||
83 | 'http://books.google.com/books/reader?id=WH4rAAAAYAAJ', |
||
84 | 'https://books.google.com/books?id=WH4rAAAAYAAJ', |
||
85 | ], |
||
86 | [ |
||
87 | // pattern rare : https://books.google.com/?id=-0h134NR1s0C |
||
88 | 'https://books.google.com/?id=-0h134NR1s0C&pg=PA167&lpg=PA167&dq=Prairie+Shores+apartments+Michael+Reese#v=onepage&q=Prairie%20Shores%20apartments%20Michael%20Reese&f=false', |
||
89 | 'https://books.google.com/books?id=-0h134NR1s0C&pg=PA167&dq=Prairie+Shores+apartments+Michael+Reese', |
||
90 | ], |
||
91 | [ |
||
92 | // frontcover |
||
93 | 'https://books.google.fr/books?id=lcHcXrVhRUUC&printsec=frontcover&hl=fr&source=gbs_ge_summary_r&cad=0#v=onepage&q&f=false', |
||
94 | 'https://books.google.fr/books?id=lcHcXrVhRUUC&printsec=frontcover', |
||
95 | ], |
||
96 | [ |
||
97 | // play.google.com (rare) |
||
98 | 'https://play.google.com/books/reader?id=1dtkAAAAMAAJ&printsec=frontcover&output=reader&hl=fr&pg=GBS.PR7', |
||
99 | 'https://books.google.com/books?id=1dtkAAAAMAAJ&pg=GBS.PR7&printsec=frontcover', |
||
100 | ], |
||
186 |