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