| Conditions | 14 |
| Paths | 512 |
| Total Lines | 60 |
| Code Lines | 34 |
| 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 namespace XoopsModules\Mymenus; |
||
| 26 | public static function getSkinInfo($moduleSkin = 'default', $useThemeSkin = false, $themeSkin = '') |
||
| 27 | { |
||
| 28 | // require __DIR__ . '/common.php'; |
||
| 29 | /** @var \XoopsModules\Mymenus\Helper $helper */ |
||
| 30 | $helper = \XoopsModules\Mymenus\Helper::getInstance(); |
||
| 31 | $error = false; |
||
| 32 | if ($useThemeSkin) { |
||
| 33 | $path = 'themes/' . $GLOBALS['xoopsConfig']['theme_set'] . '/menu'; |
||
| 34 | if (!file_exists($GLOBALS['xoops']->path("{$path}/skin_version.php"))) { |
||
| 35 | $path = 'themes/' . $GLOBALS['xoopsConfig']['theme_set'] . "/modules/{$helper->getDirname()}/skins/{$themeSkin}"; |
||
| 36 | if (!file_exists($GLOBALS['xoops']->path("{$path}/skin_version.php"))) { |
||
| 37 | $error = true; |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | if ($error || !$useThemeSkin) { |
||
| 43 | $path = "modules/{$helper->getDirname()}/skins/{$moduleSkin}"; |
||
| 44 | } |
||
| 45 | |||
| 46 | $file = $GLOBALS['xoops']->path("{$path}/skin_version.php"); |
||
| 47 | $info = []; |
||
| 48 | |||
| 49 | if (file_exists($file)) { |
||
| 50 | require $file; |
||
| 51 | $info = $skinVersion; |
||
| 52 | } |
||
| 53 | |||
| 54 | $info['path'] = $GLOBALS['xoops']->path($path); |
||
| 55 | $info['url'] = $GLOBALS['xoops']->url($path); |
||
| 56 | |||
| 57 | if (!isset($info['template'])) { |
||
| 58 | $info['template'] = $GLOBALS['xoops']->path("modules/{$helper->getDirname()}/templates/static/blocks/mymenus_block.tpl"); |
||
| 59 | } else { |
||
| 60 | $info['template'] = $GLOBALS['xoops']->path("{$path}/" . $info['template']); |
||
| 61 | } |
||
| 62 | |||
| 63 | if (!isset($info['prefix'])) { |
||
| 64 | $info['prefix'] = $moduleSkin; |
||
| 65 | } |
||
| 66 | |||
| 67 | if (isset($info['css'])) { |
||
| 68 | $info['css'] = (array)$info['css']; |
||
| 69 | foreach ($info['css'] as $key => $value) { |
||
| 70 | $info['css'][$key] = $GLOBALS['xoops']->url("{$path}/{$value}"); |
||
| 71 | } |
||
| 72 | } |
||
| 73 | |||
| 74 | if (isset($info['js'])) { |
||
| 75 | $info['js'] = (array)$info['js']; |
||
| 76 | foreach ($info['js'] as $key => $value) { |
||
| 77 | $info['js'][$key] = $GLOBALS['xoops']->url("{$path}/{$value}"); |
||
| 78 | } |
||
| 79 | } |
||
| 80 | |||
| 81 | if (!isset($info['config'])) { |
||
| 82 | $info['config'] = []; |
||
| 83 | } |
||
| 84 | |||
| 85 | return $info; |
||
| 86 | } |
||
| 88 |
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