| Conditions | 3 |
| Paths | 3 |
| Total Lines | 60 |
| Code Lines | 33 |
| 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 |
||
| 30 | public function __construct($config) |
||
| 31 | { |
||
| 32 | extract($config); |
||
| 33 | |||
| 34 | parent::__construct('', 'form_preferences', 'preferences.php', 'post', true); |
||
| 35 | $this->setExtra('enctype="multipart/form-data"'); |
||
| 36 | |||
| 37 | $tabTray = new \Xoops\Form\TabTray('', 'uniqueid'); |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Main page |
||
| 41 | */ |
||
| 42 | $tab1 = new \Xoops\Form\Tab(_XOO_CONFIG_MAINPAGE, 'tabid-1'); |
||
| 43 | $tab1->addElement(new \Xoops\Form\RadioYesNo(_XOO_CONFIG_MAIN, 'xoositemap_main', $xoositemap_main)); |
||
| 44 | |||
| 45 | // main |
||
| 46 | $tab1->addElement(new \Xoops\Form\RadioYesNo(_XOO_CONFIG_SUBCAT, 'xoositemap_subcat', $xoositemap_subcat)); |
||
| 47 | |||
| 48 | // welcome |
||
| 49 | $tab1->addElement(new \Xoops\Form\TextArea(_XOO_CONFIG_WELCOME, 'xoositemap_welcome', $xoositemap_welcome, 12, 12)); |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Main page |
||
| 53 | */ |
||
| 54 | $tab2 = new \Xoops\Form\Tab(_XOO_CONFIG_MODULES, 'tabid-2'); |
||
| 55 | $systemModule = new \SystemModule(); |
||
| 56 | $installed = $systemModule->getModuleList(); |
||
| 57 | $modules = new \Xoops\Form\Select(_XOO_CONFIG_MODULES_SELECT, 'xoositemapModule', $xoositemapModule, count($installed) - 1, true); |
||
| 58 | foreach ($installed as $module) { |
||
| 59 | $plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'xoositemap'); |
||
| 60 | if (is_object($plugin)) { |
||
| 61 | $modules->addOption($module->getVar('dirname'), $module->getVar('dirname')); |
||
| 62 | } |
||
| 63 | } |
||
| 64 | $tab2->addElement($modules); |
||
| 65 | |||
| 66 | $tabTray->addElement($tab1); |
||
| 67 | $tabTray->addElement($tab2); |
||
| 68 | $this->addElement($tabTray); |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Buttons |
||
| 72 | */ |
||
| 73 | $buttonTray = new \Xoops\Form\ElementTray('', ''); |
||
| 74 | $buttonTray->addElement(new \Xoops\Form\Hidden('op', 'save')); |
||
| 75 | |||
| 76 | $buttonSubmit = new \Xoops\Form\Button('', 'submit', \XoopsLocale::A_SUBMIT, 'submit'); |
||
| 77 | $buttonSubmit->setClass('btn btn-success'); |
||
| 78 | $buttonTray->addElement($buttonSubmit); |
||
| 79 | |||
| 80 | $buttonReset = new \Xoops\Form\Button('', 'reset', \XoopsLocale::A_RESET, 'reset'); |
||
| 81 | $buttonReset->setClass('btn btn-warning'); |
||
| 82 | $buttonTray->addElement($buttonReset); |
||
| 83 | |||
| 84 | $buttonCancel = new \Xoops\Form\Button('', 'cancel', \XoopsLocale::A_CANCEL, 'button'); |
||
| 85 | $buttonCancel->setExtra("onclick='javascript:history.go(-1);'"); |
||
| 86 | $buttonCancel->setClass('btn btn-danger'); |
||
| 87 | $buttonTray->addElement($buttonCancel); |
||
| 88 | |||
| 89 | $this->addElement($buttonTray); |
||
| 90 | } |
||
| 92 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths