| Conditions | 1 |
| Paths | 1 |
| Total Lines | 67 |
| Code Lines | 57 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| 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 |
||
| 107 | public function abbc3_bbcodes() |
||
| 108 | { |
||
| 109 | return array( |
||
| 110 | // These exists in core |
||
| 111 | 'b', |
||
| 112 | 'code', |
||
| 113 | 'color', |
||
| 114 | 'email', |
||
| 115 | 'flash', |
||
| 116 | 'i', |
||
| 117 | 'img=', |
||
| 118 | 'listb', |
||
| 119 | 'listitem', |
||
| 120 | 'listo', |
||
| 121 | 'quote', |
||
| 122 | 'size', |
||
| 123 | 'u', |
||
| 124 | 'url', |
||
| 125 | 'url=', |
||
| 126 | |||
| 127 | // These were not really BBCodes |
||
| 128 | 'copy', |
||
| 129 | 'cut', |
||
| 130 | 'grad', |
||
| 131 | 'paste', |
||
| 132 | 'plain', |
||
| 133 | 'imgshack', |
||
| 134 | |||
| 135 | // These are deprecated |
||
| 136 | 'click', |
||
| 137 | 'ed2k', |
||
| 138 | 'flv', |
||
| 139 | 'quicktime', |
||
| 140 | 'ram', |
||
| 141 | 'rapidshare', |
||
| 142 | 'stream', |
||
| 143 | 'testlink', |
||
| 144 | 'video', |
||
| 145 | 'wave=', |
||
| 146 | 'web', |
||
| 147 | 'scrippet', |
||
| 148 | 'search', |
||
| 149 | 'thumbnail', |
||
| 150 | 'hr', // no closing |
||
| 151 | 'tab=', // no closing |
||
| 152 | 'tabs', |
||
| 153 | 'table=', |
||
| 154 | 'anchor=', |
||
| 155 | 'upload', |
||
| 156 | 'html', |
||
| 157 | 'collegehumor', |
||
| 158 | 'dm', |
||
| 159 | 'gamespot', |
||
| 160 | 'ignvideo', |
||
| 161 | 'liveleak', |
||
| 162 | 'veoh', |
||
| 163 | |||
| 164 | // These are being replaced by new BBCodes |
||
| 165 | 'align=justify', // replaced by align= |
||
| 166 | 'align=left', // replaced by align= |
||
| 167 | 'align=right', // replaced by align= |
||
| 168 | 'dir=rtl', // replaced by dir= |
||
| 169 | 'marq=down', // replaced by marq= |
||
| 170 | 'marq=left', // replaced by marq= |
||
| 171 | 'marq=right', // replaced by marq= |
||
| 172 | ); |
||
| 173 | } |
||
| 174 | } |
||
| 175 |