| Conditions | 13 |
| Paths | 4096 |
| Total Lines | 72 |
| Code Lines | 51 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| 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); |
||
| 119 | function membersonline_edit($options) |
||
| 120 | { |
||
| 121 | $chk = ''; |
||
| 122 | $form = _MB_XOOPSMEMBERS_SHOWONLINEMEMBER . ' '; |
||
| 123 | if ($options[0] == 1) { |
||
| 124 | $chk = ' checked'; |
||
| 125 | } |
||
| 126 | $form .= "<input type='radio' name='options[0]' value='1'" . $chk . '> ' . _YES . ''; |
||
| 127 | if ($options[0] == 0) { |
||
| 128 | $chk = ' checked'; |
||
| 129 | } |
||
| 130 | $form .= " <input type='radio' name='options[0]' value='0'" . $chk . '>' . _NO . '<br>'; |
||
| 131 | |||
| 132 | $form .= _MB_XOOPSMEMBERS_SHOWONLINENAME . ' '; |
||
| 133 | if ($options[1] == 1) { |
||
| 134 | $chk = ' checked'; |
||
| 135 | } |
||
| 136 | $form .= "<input type='radio' name='options[1]' value='1'" . $chk . '> ' . _YES . ''; |
||
| 137 | $chk = ''; |
||
| 138 | if ($options[1] == 0) { |
||
| 139 | $chk = ' checked'; |
||
| 140 | } |
||
| 141 | $form .= " <input type='radio' name='options[1]' value='0'" . $chk . '>' . _NO . '<br>'; |
||
| 142 | |||
| 143 | $form .= _MB_XOOPSMEMBERS_SHOWONLINEAVATAR . ' '; |
||
| 144 | if ($options[2] == 1) { |
||
| 145 | $chk = ' checked'; |
||
| 146 | } |
||
| 147 | $form .= "<input type='radio' name='options[2]' value='1'" . $chk . '> ' . _YES . ''; |
||
| 148 | $chk = ''; |
||
| 149 | if ($options[2] == 0) { |
||
| 150 | $chk = ' checked'; |
||
| 151 | } |
||
| 152 | $form .= " <input type='radio' name='options[2]' value='0'" . $chk . '>' . _NO . '<br>'; |
||
| 153 | |||
| 154 | $form .= _MB_XOOPSMEMBERS_SHOWONLINEPOPUP . ' '; |
||
| 155 | if ($options[3] == 1) { |
||
| 156 | $chk = ' checked'; |
||
| 157 | } |
||
| 158 | $form .= "<input type='radio' name='options[3]' value='1'" . $chk . '> ' . _YES . ''; |
||
| 159 | $chk = ''; |
||
| 160 | if ($options[3] == 0) { |
||
| 161 | $chk = ' checked'; |
||
| 162 | } |
||
| 163 | $form .= " <input type='radio' name='options[3]' value='0'" . $chk . '>' . _NO . '<br>'; |
||
| 164 | |||
| 165 | $form .= _MB_XOOPSMEMBERS_SHOWTOTALONLINE . ' '; |
||
| 166 | if ($options[4] == 1) { |
||
| 167 | $chk = ' checked'; |
||
| 168 | } |
||
| 169 | $form .= "<input type='radio' name='options[4]' value='1'" . $chk . '> ' . _YES . ''; |
||
| 170 | $chk = ''; |
||
| 171 | if ($options[4] == 0) { |
||
| 172 | $chk = ' checked'; |
||
| 173 | } |
||
| 174 | $form .= " <input type='radio' name='options[4]' value='0'" . $chk . '>' . _NO . '<br>'; |
||
| 175 | |||
| 176 | $form .= _MB_XOOPSMEMBERS_USEREALNAME . ' '; |
||
| 177 | if ($options[5] == 1) { |
||
| 178 | $chk = ' checked'; |
||
| 179 | } |
||
| 180 | $form .= "<input type='radio' name='options[5]' value='1'" . $chk . '> ' . _YES . ''; |
||
| 181 | $chk = ''; |
||
| 182 | if ($options[5] == 0) { |
||
| 183 | $chk = ' checked'; |
||
| 184 | } |
||
| 185 | $form .= " <input type='radio' name='options[5]' value='0'" . $chk . '>' . _NO . '<br>'; |
||
| 186 | |||
| 187 | $form .= _MB_XOOPSMEMBERS_MEMBERDISPLAY . ' '; |
||
| 188 | $form .= "<input type='text' name='options[6]' value='" . $options[6] . "'>"; |
||
| 189 | |||
| 190 | return $form; |
||
| 191 | } |
||
| 192 |