| Conditions | 13 |
| Paths | 4096 |
| Total Lines | 71 |
| Code Lines | 51 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| 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 |
||
| 119 | function membersonline_edit($options) { |
||
| 120 | |||
| 121 | $form = _MB_XOOPSMEMBERS_SHOWONLINEMEMBER." "; |
||
| 122 | if ( $options[0] == 1 ) { |
||
| 123 | $chk = " checked='checked'"; |
||
| 124 | } |
||
| 125 | $form .= "<input type='radio' name='options[0]' value='1'".$chk." /> "._YES.""; |
||
| 126 | $chk = ""; |
||
| 127 | if ( $options[0] == 0 ) { |
||
| 128 | $chk = " checked='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='checked'"; |
||
| 135 | } |
||
| 136 | $form .= "<input type='radio' name='options[1]' value='1'".$chk." /> "._YES.""; |
||
| 137 | $chk = ""; |
||
| 138 | if ( $options[1] == 0 ) { |
||
| 139 | $chk = " checked='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='checked'"; |
||
| 146 | } |
||
| 147 | $form .= "<input type='radio' name='options[2]' value='1'".$chk." /> "._YES.""; |
||
| 148 | $chk = ""; |
||
| 149 | if ( $options[2] == 0 ) { |
||
| 150 | $chk = " checked='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='checked'"; |
||
| 157 | } |
||
| 158 | $form .= "<input type='radio' name='options[3]' value='1'".$chk." /> "._YES.""; |
||
| 159 | $chk = ""; |
||
| 160 | if ( $options[3] == 0 ) { |
||
| 161 | $chk = " checked='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='checked'"; |
||
| 168 | } |
||
| 169 | $form .= "<input type='radio' name='options[4]' value='1'".$chk." /> "._YES.""; |
||
| 170 | $chk = ""; |
||
| 171 | if ( $options[4] == 0 ) { |
||
| 172 | $chk = " checked='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='checked'"; |
||
| 179 | } |
||
| 180 | $form .= "<input type='radio' name='options[5]' value='1'".$chk." /> "._YES.""; |
||
| 181 | $chk = ""; |
||
| 182 | if ( $options[5] == 0 ) { |
||
| 183 | $chk = " checked='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 | return $form; |
||
| 190 | } |
||
| 193 |