Conditions | 1 |
Paths | 1 |
Total Lines | 90 |
Code Lines | 57 |
Lines | 0 |
Ratio | 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 |
||
140 | public function abbc3_bbcodes() |
||
141 | { |
||
142 | return array( |
||
143 | // These exists in core |
||
144 | 'b', |
||
145 | 'code', |
||
146 | 'color', |
||
147 | 'email', |
||
148 | 'flash', |
||
149 | 'i', |
||
150 | 'img=', |
||
151 | 'listb', |
||
152 | 'listitem', |
||
153 | 'listo', |
||
154 | 'quote', |
||
155 | 'size', |
||
156 | 'u', |
||
157 | 'url', |
||
158 | 'url=', |
||
159 | |||
160 | // These were not really BBCodes |
||
161 | 'copy', |
||
162 | 'cut', |
||
163 | 'grad', |
||
164 | 'paste', |
||
165 | 'plain', |
||
166 | 'imgshack', |
||
167 | |||
168 | // These are deprecated |
||
169 | 'click', // click_pass |
||
170 | 'ed2k', |
||
171 | 'flv', // auto_embed_video |
||
172 | 'quicktime', |
||
173 | 'ram', |
||
174 | 'rapidshare', // rapidshare_pass |
||
175 | 'stream', |
||
176 | 'testlink', // testlink_pass |
||
177 | 'video', |
||
178 | 'wave=', // Text_effect_pass |
||
179 | 'web', |
||
180 | 'scrippet', // scrippets_pass |
||
181 | 'search', // search_pass |
||
182 | 'thumbnail', // thumb_pass |
||
183 | 'hr', // no closing |
||
184 | 'tab=', // no closing |
||
185 | 'tabs', // simpleTabs_pass |
||
186 | 'table=', // table_pass |
||
187 | 'anchor=', // anchor_pass |
||
188 | 'upload', |
||
189 | 'html', |
||
190 | 'collegehumor', // auto_embed_video |
||
191 | 'dm', // auto_embed_video |
||
192 | 'gamespot', // auto_embed_video |
||
193 | 'ignvideo', // auto_embed_video |
||
194 | 'liveleak', // auto_embed_video |
||
195 | 'veoh', // auto_embed_video |
||
196 | |||
197 | // These are being replaced by new BBCodes |
||
198 | 'align=justify', // replaced by align= |
||
199 | 'align=left', // replaced by align= |
||
200 | 'align=right', // replaced by align= |
||
201 | 'dir=rtl', // replaced by dir= |
||
202 | 'marq=down', // replaced by marq= |
||
203 | 'marq=left', // replaced by marq= |
||
204 | 'marq=right', // replaced by marq= |
||
205 | |||
206 | // These will be updated in another migration |
||
207 | // 'align=center', // replaced by align= |
||
208 | // 'blur=', // Text_effect_pass |
||
209 | // 'dir=ltr', // replaced by dir= |
||
210 | // 'dropshadow=', // Text_effect_pass |
||
211 | // 'fade', |
||
212 | // 'font=', |
||
213 | // 'glow=', // Text_effect_pass |
||
214 | // 'highlight=', |
||
215 | // 'marq=up', // replaced by marq= |
||
216 | // 'mod=', // mod_pass |
||
217 | // 'nfo', // nfo_pass |
||
218 | // 'offtopic', // offtopic_pass |
||
219 | // 'pre', |
||
220 | // 's', |
||
221 | // 'shadow=', // Text_effect_pass |
||
222 | // 'spoil', // spoil_pass |
||
223 | // 'sub', |
||
224 | // 'sup', |
||
225 | // 'youtube', // BBvideo_pass |
||
226 | // 'BBvideo', // BBvideo_pass |
||
227 | // 'hidden', // hidden_pass |
||
228 | ); |
||
229 | } |
||
230 | } |
||
231 |