| Conditions | 11 |
| Paths | 1024 |
| Total Lines | 58 |
| Code Lines | 41 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| 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 declare(strict_types=1); |
||
| 121 | function membersstats_edit($options) |
||
| 122 | { |
||
| 123 | $form = _MB_XOOPSMEMBERS_SHOWTOTALPOST . ' '; |
||
| 124 | if (1 == $options[0]) { |
||
| 125 | $chk = ' checked'; |
||
| 126 | } |
||
| 127 | $form .= "<input type='radio' name='options[0]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 128 | $chk = ''; |
||
| 129 | if (0 == $options[0]) { |
||
| 130 | $chk = ' checked'; |
||
| 131 | } |
||
| 132 | $form .= " <input type='radio' name='options[0]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 133 | |||
| 134 | $form .= _MB_XOOPSMEMBERS_SHOWTOTALONLINE . ' '; |
||
| 135 | if (1 == $options[1]) { |
||
| 136 | $chk = ' checked'; |
||
| 137 | } |
||
| 138 | $form .= "<input type='radio' name='options[1]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 139 | $chk = ''; |
||
| 140 | if (0 == $options[1]) { |
||
| 141 | $chk = ' checked'; |
||
| 142 | } |
||
| 143 | $form .= " <input type='radio' name='options[1]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 144 | |||
| 145 | $form .= _MB_XOOPSMEMBERS_SHOWREGHISTORY . ' '; |
||
| 146 | if (1 == $options[2]) { |
||
| 147 | $chk = ' checked'; |
||
| 148 | } |
||
| 149 | $form .= "<input type='radio' name='options[2]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 150 | $chk = ''; |
||
| 151 | if (0 == $options[2]) { |
||
| 152 | $chk = ' checked'; |
||
| 153 | } |
||
| 154 | $form .= " <input type='radio' name='options[2]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 155 | |||
| 156 | $form .= _MB_XOOPSMEMBERS_SHOWNEWMEMBER . ' '; |
||
| 157 | if (1 == $options[3]) { |
||
| 158 | $chk = ' checked'; |
||
| 159 | } |
||
| 160 | $form .= "<input type='radio' name='options[3]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 161 | $chk = ''; |
||
| 162 | if (0 == $options[3]) { |
||
| 163 | $chk = ' checked'; |
||
| 164 | } |
||
| 165 | $form .= " <input type='radio' name='options[3]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 166 | |||
| 167 | $form .= _MB_XOOPSMEMBERS_USEREALNAME . ' '; |
||
| 168 | if (1 == $options[4]) { |
||
| 169 | $chk = ' checked'; |
||
| 170 | } |
||
| 171 | $form .= "<input type='radio' name='options[4]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 172 | $chk = ''; |
||
| 173 | if (0 == $options[4]) { |
||
| 174 | $chk = ' checked'; |
||
| 175 | } |
||
| 176 | $form .= " <input type='radio' name='options[4]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 177 | |||
| 178 | return $form; |
||
| 179 | } |
||
| 180 |