Conditions | 11 |
Paths | 243 |
Total Lines | 50 |
Code Lines | 32 |
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 |
||
24 | function xoops_module_update_animal() |
||
25 | { |
||
26 | global $xoopsDB; |
||
27 | |||
28 | if (Utility::tableExists($GLOBALS['xoopsDB']->prefix('owner'))) { |
||
|
|||
29 | $sql = sprintf('ALTER TABLE ' . $GLOBALS['xoopsDB']->prefix('owner') . ' RENAME ' . $GLOBALS['xoopsDB']->prefix('pedigree_owner')); |
||
30 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
||
31 | if (!$result) { |
||
32 | echo '<br>' . _AM_PEDIGREE_UPGRADEFAILED . ' ' . _AM_PEDIGREE_UPGRADEFAILED2; |
||
33 | ++$errors; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | if (Utility::tableExists($GLOBALS['xoopsDB']->prefix('stamboom'))) { |
||
38 | $sql = sprintf('ALTER TABLE ' . $GLOBALS['xoopsDB']->prefix('stamboom') . ' RENAME ' . $GLOBALS['xoopsDB']->prefix('pedigree_registry')); |
||
39 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
||
40 | if (!$result) { |
||
41 | echo '<br>' . _AM_PEDIGREE_UPGRADEFAILED . ' ' . _AM_PEDIGREE_UPGRADEFAILED2; |
||
42 | ++$errors; |
||
43 | } |
||
44 | } |
||
45 | |||
46 | if (Utility::tableExists($GLOBALS['xoopsDB']->prefix('pedigree_fields'))) { |
||
47 | $sql = sprintf('ALTER TABLE ' . $GLOBALS['xoopsDB']->prefix('pedigree_fields') . ' RENAME ' . $GLOBALS['xoopsDB']->prefix('pedigree_fields')); |
||
48 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
||
49 | if (!$result) { |
||
50 | echo '<br>' . _AM_PEDIGREE_UPGRADEFAILED . ' ' . _AM_PEDIGREE_UPGRADEFAILED2; |
||
51 | ++$errors; |
||
52 | } |
||
53 | } |
||
54 | |||
55 | if (Utility::tableExists($GLOBALS['xoopsDB']->prefix('pedigree_temp'))) { |
||
56 | $sql = sprintf('ALTER TABLE ' . $GLOBALS['xoopsDB']->prefix('pedigree_temp') . ' RENAME ' . $GLOBALS['xoopsDB']->prefix('pedigree_temp')); |
||
57 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
||
58 | if (!$result) { |
||
59 | echo '<br>' . _AM_PEDIGREE_UPGRADEFAILED . ' ' . _AM_PEDIGREE_UPGRADEFAILED2; |
||
60 | ++$errors; |
||
61 | } |
||
62 | } |
||
63 | |||
64 | if (Utility::tableExists($GLOBALS['xoopsDB']->prefix('pedigree_trash'))) { |
||
65 | $sql = sprintf('ALTER TABLE ' . $GLOBALS['xoopsDB']->prefix('pedigree_trash') . ' RENAME ' . $GLOBALS['xoopsDB']->prefix('pedigree_trash')); |
||
66 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
||
67 | if (!$result) { |
||
68 | echo '<br>' . _AM_PEDIGREE_UPGRADEFAILED . ' ' . _AM_PEDIGREE_UPGRADEFAILED2; |
||
69 | ++$errors; |
||
70 | } |
||
71 | } |
||
72 | |||
73 | return true; |
||
74 | } |
||
75 |
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