Conditions | 11 |
Paths | 192 |
Total Lines | 59 |
Code Lines | 42 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
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 |
||
166 | public function render($currentoption = 1, $display = true) |
||
167 | { |
||
168 | global $modversion; |
||
169 | $_dirname = $this->_obj->getVar('dirname'); |
||
170 | $i = 0; |
||
171 | |||
172 | /** |
||
173 | * Selects current menu tab |
||
174 | */ |
||
175 | foreach ($this->_menutabs as $k => $menus) { |
||
176 | $menuItems[] = $menus; |
||
177 | } |
||
178 | $breadcrumb = $menuItems[$currentoption]; |
||
179 | /*$menuItems[$currentoption] = 'current';*/ |
||
180 | $menu = "<div id='buttontop_mod'>"; |
||
181 | $menu .= "<table style='width: 100%; padding: 0;' cellspacing='0'>\n<tr>"; |
||
182 | $menu .= "<td style='font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;'>"; |
||
183 | foreach ($this->_menutop as $k => $v) { |
||
184 | $menu .= " <a href=\"$k\">$v</a> |"; |
||
185 | } |
||
186 | $menu = substr($menu, 0, -1); |
||
187 | |||
188 | $menu .= '</td>'; |
||
189 | $menu .= "<td style='text-align: right;'><strong>" . $this->_obj->getVar('name') . '</strong> : ' . $breadcrumb . '</td>'; |
||
190 | $menu .= "</tr>\n</table>\n"; |
||
191 | $menu .= "</div>\n"; |
||
192 | $menu .= "<div id='buttonbar_mod'><ul>"; |
||
193 | foreach ($this->_menutabs as $k => $v) { |
||
194 | $temp = ($menuItems[$i] == 'current') ? 'current' : 'menu_'.$i; |
||
195 | $menu .= '<li id="'.$temp. '"><a href="' . XOOPS_URL . '/modules/' . $this->_obj->getVar('dirname') . '/' . $k . '"><span>'.$v.'</span></a></li>'."\n"; |
||
196 | ++$i; |
||
197 | } |
||
198 | $menu .= "</ul>\n</div>\n"; |
||
199 | if ($this->_header) { |
||
200 | $menu .= "<h4 class='admin_header'>"; |
||
201 | if (isset($modversion['name'])) { |
||
202 | if ($modversion['image'] && $this->_obj->getVar('mid') == 1) { |
||
203 | $system_image = XOOPS_URL . '/modules/system/images/system/' . $modversion['image']; |
||
204 | } else { |
||
205 | $system_image = XOOPS_URL . '/modules/' . $_dirname . '/images/' . $modversion['image']; |
||
206 | } |
||
207 | $menu .= "<img src='$system_image' align='middle' height='32' width='32' alt='' />"; |
||
208 | $menu .= ' ' . $modversion['name'] . "</h4>\n"; |
||
209 | } else { |
||
210 | $menu .= ' ' . $this->_header . "</h4>\n"; |
||
211 | } |
||
212 | } |
||
213 | if ($this->_subheader) { |
||
214 | $menu .= "<div class='admin_subheader'>" . $this->_subheader . "</div>\n"; |
||
215 | } |
||
216 | $menu .= '<div class="clear"> </div>'; |
||
217 | unset($this->_obj); |
||
218 | if ($display === true) { |
||
219 | echo $menu; |
||
220 | } else { |
||
221 | return $menu; |
||
222 | } |
||
223 | |||
224 | return null; |
||
225 | } |
||
227 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.