| Conditions | 7 |
| Paths | 36 |
| Total Lines | 60 |
| Code Lines | 41 |
| 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 |
||
| 36 | public function doDefault() |
||
| 37 | { |
||
| 38 | $intro_html = $this->printHeader('Intro', $this->scripts, false); |
||
| 39 | $intro_html .= $this->printBody(false); |
||
| 40 | |||
| 41 | $intro_html .= $this->printTrail('root', false); |
||
| 42 | |||
| 43 | $intro_html .= $this->printTabs('root', 'intro', false); |
||
| 44 | |||
| 45 | $intro_html .= '<h1>'.$this->appName.' '.$this->appVersion.' (PHP '.PHP_VERSION.')</h1>'; |
||
| 46 | |||
| 47 | $intro_html .= '<form method="get" action="intro.php">'; |
||
| 48 | $intro_html .= '<table>'; |
||
| 49 | $intro_html .= '<tr class="data1">'; |
||
| 50 | $intro_html .= '<th class="data">'.$this->lang['strlanguage'].'</th>'; |
||
| 51 | $intro_html .= '<td>'; |
||
| 52 | $intro_html .= '<select name="language" onchange="this.form.submit()">'; |
||
| 53 | |||
| 54 | $this->language = isset($_SESSION['webdbLanguage']) ? $_SESSION['webdbLanguage'] : 'english'; |
||
| 55 | foreach ($this->appLangFiles as $k => $v) { |
||
| 56 | $selected = ($k == $this->language) ? ' selected="selected"' : ''; |
||
| 57 | $intro_html .= "\t<option value=\"{$k}\"".$selected.">{$v}</option>\n"; |
||
| 58 | } |
||
| 59 | |||
| 60 | $intro_html .= '</select>'; |
||
| 61 | $intro_html .= '</td>'; |
||
| 62 | $intro_html .= '</tr>'; |
||
| 63 | $intro_html .= '<tr class="data2">'; |
||
| 64 | $intro_html .= '<th class="data">'.$this->lang['strtheme'].'</th>'; |
||
| 65 | $intro_html .= '<td>'; |
||
| 66 | $intro_html .= '<select name="theme" onchange="this.form.submit()">'; |
||
| 67 | |||
| 68 | foreach ($this->appThemes as $k => $v) { |
||
| 69 | $selected = ($k == $this->conf['theme']) ? ' selected="selected"' : ''; |
||
| 70 | $intro_html .= "\t<option value=\"{$k}\"".$selected.">{$v}</option>\n"; |
||
| 71 | } |
||
| 72 | |||
| 73 | $intro_html .= '</select>'; |
||
| 74 | $intro_html .= '</td>'; |
||
| 75 | $intro_html .= '</tr>'; |
||
| 76 | $intro_html .= '</table>'; |
||
| 77 | $intro_html .= '<noscript><p><input type="submit" value="'.$this->lang['stralter'].'" /></p></noscript>'; |
||
| 78 | $intro_html .= '</form>'; |
||
| 79 | |||
| 80 | $intro_html .= '<p>'.$this->lang['strintro'].'</p>'; |
||
| 81 | |||
| 82 | $intro_html .= '<ul class="intro">'; |
||
| 83 | $intro_html .= ' <li><a href="https://github.com/HuasoFoundries/phpPgAdmin6">'.$this->lang['strppahome'].'</a></li>'; |
||
| 84 | $intro_html .= '<li><a href="'.$this->lang['strpgsqlhome_url'].'">'.$this->lang['strpgsqlhome'].'</a></li>'; |
||
| 85 | $intro_html .= '<li><a href="https://github.com/HuasoFoundries/phpPgAdmin6/issues">'.$this->lang['strreportbug'].'</a></li>'; |
||
| 86 | //$intro_html .= '<li><a href="' . $this->lang['strviewfaq_url'] . '">' . $this->lang['strviewfaq'] . '</a></li>'; |
||
| 87 | $intro_html .= '</ul>'; |
||
| 88 | |||
| 89 | if ($this->container->requestobj->getQueryParam('language')) { |
||
| 90 | $this->misc->setReloadBrowser(true); |
||
| 91 | } |
||
| 92 | |||
| 93 | $intro_html .= $this->printFooter(false); |
||
| 94 | |||
| 95 | return $intro_html; |
||
| 96 | } |
||
| 98 |