Conditions | 10 |
Paths | 512 |
Total Lines | 41 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | 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 |
||
34 | public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) |
||
35 | { |
||
36 | /** @var ISchemaWrapper $schema */ |
||
37 | $schema = $schemaClosure(); |
||
38 | |||
39 | $table = $schema->getTable('analytics_dataset'); |
||
40 | if (!$table->hasColumn('ai_index')) { |
||
41 | $table->addColumn('ai_index', 'integer', [ |
||
42 | 'notnull' => false |
||
43 | ]); |
||
44 | } |
||
45 | if ($table->hasColumn('chartoptions')) { |
||
46 | $table->dropColumn('chartoptions'); |
||
47 | } |
||
48 | if ($table->hasColumn('dataoptions')) { |
||
49 | $table->dropColumn('dataoptions'); |
||
50 | } |
||
51 | if ($table->hasColumn('filteroptions')) { |
||
52 | $table->dropColumn('filteroptions'); |
||
53 | } |
||
54 | if ($table->hasColumn('refresh')) { |
||
55 | $table->dropColumn('refresh'); |
||
56 | } |
||
57 | if ($table->hasColumn('link')) { |
||
58 | $table->dropColumn('link'); |
||
59 | } |
||
60 | if ($table->hasColumn('visualization')) { |
||
61 | $table->dropColumn('visualization'); |
||
62 | } |
||
63 | if ($table->hasColumn('chart')) { |
||
64 | $table->dropColumn('chart'); |
||
65 | } |
||
66 | |||
67 | $table = $schema->getTable('analytics_share'); |
||
68 | if (!$table->hasColumn('panorama')) { |
||
69 | $table->addColumn('panorama', 'integer', [ |
||
70 | 'notnull' => false, |
||
71 | ]); |
||
72 | } |
||
73 | |||
74 | return $schema; |
||
75 | } |
||
76 | } |
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