| Conditions | 10 |
| Paths | 8 |
| Total Lines | 44 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 2 | 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 |
||
| 58 | function xoops_module_install_publisher(\XoopsModule $module) |
||
| 59 | { |
||
| 60 | require dirname(__DIR__) . '/preloads/autoloader.php'; |
||
| 61 | |||
| 62 | $helper = Helper::getInstance(); |
||
| 63 | $utility = new Utility(); |
||
| 64 | $configurator = new Common\Configurator(); |
||
|
|
|||
| 65 | |||
| 66 | // Load language files |
||
| 67 | $helper->loadLanguage('admin'); |
||
| 68 | $helper->loadLanguage('modinfo'); |
||
| 69 | |||
| 70 | // --- CREATE FOLDERS --------------- |
||
| 71 | if ($configurator->uploadFolders && is_array($configurator->uploadFolders)) { |
||
| 72 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
||
| 73 | foreach (array_keys($configurator->uploadFolders) as $i) { |
||
| 74 | $utility::createFolder($configurator->uploadFolders[$i]); |
||
| 75 | } |
||
| 76 | } |
||
| 77 | |||
| 78 | // --- COPY blank.png FILES --------------- |
||
| 79 | if ($configurator->copyBlankFiles && is_array($configurator->copyBlankFiles)) { |
||
| 80 | $file = dirname(__DIR__) . '/assets/images/blank.png'; |
||
| 81 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
||
| 82 | $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
||
| 83 | $utility::copyFile($file, $dest); |
||
| 84 | } |
||
| 85 | } |
||
| 86 | |||
| 87 | // --- COPY test folder files --------------- |
||
| 88 | if ($configurator->copyTestFolders && is_array($configurator->copyTestFolders)) { |
||
| 89 | // $file = dirname(__DIR__) . '/testdata/images/'; |
||
| 90 | foreach (array_keys($configurator->copyTestFolders) as $i) { |
||
| 91 | $src = $configurator->copyTestFolders[$i][0]; |
||
| 92 | $dest = $configurator->copyTestFolders[$i][1]; |
||
| 93 | $utility::rcopy($src, $dest); |
||
| 94 | } |
||
| 95 | } |
||
| 96 | |||
| 97 | //delete .html entries from the tpl table |
||
| 98 | $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
||
| 99 | $GLOBALS['xoopsDB']->queryF($sql); |
||
| 100 | |||
| 101 | return true; |
||
| 102 | } |
||
| 103 |
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