| Conditions | 18 |
| Paths | 512 |
| Total Lines | 57 |
| Code Lines | 36 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | 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 |
||
| 64 | function b_suico_lastpictures_edit($options) |
||
| 65 | { |
||
| 66 | $form = _MB_SUICO_SHOWPICTURETITLE . ' '; |
||
| 67 | $chk = ''; |
||
| 68 | if (isset($options[0]) && 0 != $options[0]) { |
||
| 69 | $chk = ' checked'; |
||
| 70 | } |
||
| 71 | $form .= "<input type='radio' name='options[0]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 72 | $chk = ''; |
||
| 73 | if (!isset($options[0]) || 0 == $options[0]) { |
||
| 74 | $chk = ' checked'; |
||
| 75 | } |
||
| 76 | $form .= " <input type='radio' name='options[0]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 77 | |||
| 78 | |||
| 79 | $form .= _MB_SUICO_SHOWPICTURECAPTION . ' '; |
||
| 80 | if (isset($options[1]) && 1 == $options[1]) { |
||
| 81 | $chk = ' checked'; |
||
| 82 | } |
||
| 83 | $form .= "<input type='radio' name='options[1]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 84 | $chk = ''; |
||
| 85 | if (!isset($options[1]) || 0 == $options[1]) { |
||
| 86 | $chk = ' checked'; |
||
| 87 | } |
||
| 88 | $form .= " <input type='radio' name='options[1]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 89 | |||
| 90 | $form .= _MB_SUICO_SHOWPICTUREDATE . ' '; |
||
| 91 | if (isset($options[2]) && 1 == $options[2]) { |
||
| 92 | $chk = ' checked'; |
||
| 93 | } |
||
| 94 | |||
| 95 | |||
| 96 | $form .= "<input type='radio' name='options[2]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 97 | $chk = ''; |
||
| 98 | if (!isset($options[2]) || 0 == $options[2]) { |
||
| 99 | $chk = ' checked'; |
||
| 100 | } |
||
| 101 | $form .= " <input type='radio' name='options[2]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 102 | |||
| 103 | |||
| 104 | $form .= _MB_SUICO_SHOWPICTUREOWNER . ' '; |
||
| 105 | if (isset($options[3]) && 1 == $options[3]) { |
||
| 106 | $chk = ' checked'; |
||
| 107 | } |
||
| 108 | |||
| 109 | |||
| 110 | $form .= "<input type='radio' name='options[3]' value='1'" . $chk . ' > ' . _YES . ''; |
||
| 111 | $chk = ''; |
||
| 112 | if (!isset($options[3]) || 0 == $options[3]) { |
||
| 113 | $chk = ' checked'; |
||
| 114 | } |
||
| 115 | $form .= " <input type='radio' name='options[3]' value='0'" . $chk . ' >' . _NO . '<br>'; |
||
| 116 | |||
| 117 | |||
| 118 | $form .= _MB_SUICO_TOTALPICTUREDISPLAY . ' '; |
||
| 119 | $form .= "<input type='text' name='options[4]' value='" . (isset($options[4]) ? $options[4]:0) . "'>"; |
||
| 120 | return $form; |
||
| 121 | } |
||
| 122 |