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