| Conditions | 14 |
| Paths | 26 |
| Total Lines | 66 |
| Code Lines | 47 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 187 | public function render() |
||
| 188 | { |
||
| 189 | $ele_name = $this->getName(); |
||
| 190 | $ret = ''; |
||
| 191 | $ret .= "<form name='{$ele_name}' id='{$ele_name}' action='{$this->getAction()}' method='{$this->getMethod()}' onsubmit='return xoopsFormValidate_{$ele_name}();' {$this->getExtra()} >" . NWLINE; |
||
| 192 | $ret .= "<table width='100%' class='outer' cellspacing='1'>" . NWLINE; |
||
| 193 | $ret .= "<tr><th colspan='{$this->_columns}'>{$this->getTitle()}</th></tr>" . NWLINE; |
||
| 194 | if (\count($this->_titles) > 0) { |
||
| 195 | $ret .= '<tr>'; |
||
| 196 | for ($column = 0; $column < $this->_columns; ++$column) { |
||
| 197 | $ret .= '<th>'; |
||
| 198 | $ret .= isset($this->_titles[$column]) ? (string)$this->_titles[$column] : ' '; |
||
| 199 | $ret .= '</th>' . NWLINE; |
||
| 200 | } |
||
| 201 | $ret .= '</tr>'; |
||
| 202 | } |
||
| 203 | $hidden = ''; |
||
| 204 | $class = 'even'; |
||
| 205 | for ($row = 0; $row < $this->_rows; ++$row) { |
||
| 206 | $ret .= '<tr>'; |
||
| 207 | for ($column = 0; $column < $this->_columns; ++$column) { |
||
| 208 | $ret .= "<td class='{$class}'>"; |
||
| 209 | $ele = $this->_elements[$row][$column] ?? ' '; |
||
| 210 | if (!\is_object($ele)) { |
||
| 211 | $ret .= $ele; |
||
| 212 | } elseif (!$ele->isHidden()) { |
||
| 213 | if (!$ele->getNocolspan()) { |
||
| 214 | //$ret .= '<tr valign="top" align="left"><td class="head">'; |
||
| 215 | if ('' !== ($caption = $ele->getCaption())) { |
||
| 216 | $ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>"; |
||
| 217 | $ret .= "<span class='caption-text'>{$caption}</span>"; |
||
| 218 | $ret .= "<span class='caption-marker'>*</span>"; |
||
| 219 | $ret .= '</div>'; |
||
| 220 | } |
||
| 221 | if ('' !== ($desc = $ele->getDescription())) { |
||
| 222 | $ret .= "<div class='xoops-form-element-help'>{$desc}</div>"; |
||
| 223 | } |
||
| 224 | //$ret .= '</td><td class="' . $class . '">'; |
||
| 225 | $ret .= $ele->render(); |
||
| 226 | //$ret .= '</td></tr>' . NWLINE; |
||
| 227 | } else { |
||
| 228 | //$ret .= '<tr valign="top" align="left"><td class="head" colspan="2">'; |
||
| 229 | if ('' !== ($caption = $ele->getCaption())) { |
||
| 230 | $ret .= "<div class='xoops-form-element-caption" . ($ele->isRequired() ? '-required' : '') . "'>"; |
||
| 231 | $ret .= "<span class='caption-text'>{$caption}</span>"; |
||
| 232 | $ret .= "<span class='caption-marker'>*</span>"; |
||
| 233 | $ret .= '</div>'; |
||
| 234 | } |
||
| 235 | //$ret .= '</td></tr>' . NWLINE; |
||
| 236 | //$ret .= '<tr valign="top" align="left"><td class="' . $class . '" colspan="' . $this->_columns . '">'; |
||
| 237 | $ret .= $ele->render(); |
||
| 238 | //$ret .= '</td></tr>' . NWLINE; |
||
| 239 | } |
||
| 240 | } else { |
||
| 241 | $hidden .= $ele->render(); |
||
| 242 | } |
||
| 243 | $ret .= '</td>'; |
||
| 244 | } |
||
| 245 | $ret .= '</tr>'; |
||
| 246 | } |
||
| 247 | $ret .= '</table>' . NWLINE; |
||
| 248 | $ret .= $hidden . NWLINE; |
||
| 249 | $ret .= '</form>' . NWLINE; |
||
| 250 | $ret .= $this->renderValidationJS(true); |
||
| 251 | |||
| 252 | return $ret; |
||
| 253 | } |
||
| 255 |
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.