| Conditions | 11 |
| Paths | 1024 |
| Total Lines | 46 |
| Code Lines | 28 |
| 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 |
||
| 36 | public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) |
||
| 37 | { |
||
| 38 | /** @var ISchemaWrapper $schema */ |
||
| 39 | $schema = $schemaClosure(); |
||
| 40 | |||
| 41 | $table = $schema->getTable('analytics_dataset'); |
||
| 42 | if (!$table->hasColumn('ai_index')) { |
||
| 43 | $table->addColumn('ai_index', 'integer', [ |
||
| 44 | 'notnull' => false |
||
| 45 | ]); |
||
| 46 | } |
||
| 47 | if ($table->hasColumn('chartoptions')) { |
||
| 48 | $table->dropColumn('chartoptions'); |
||
| 49 | } |
||
| 50 | if ($table->hasColumn('dataoptions')) { |
||
| 51 | $table->dropColumn('dataoptions'); |
||
| 52 | } |
||
| 53 | if ($table->hasColumn('filteroptions')) { |
||
| 54 | $table->dropColumn('filteroptions'); |
||
| 55 | } |
||
| 56 | if ($table->hasColumn('refresh')) { |
||
| 57 | $table->dropColumn('refresh'); |
||
| 58 | } |
||
| 59 | if ($table->hasColumn('link')) { |
||
| 60 | $table->dropColumn('link'); |
||
| 61 | } |
||
| 62 | if ($table->hasColumn('visualization')) { |
||
| 63 | $table->dropColumn('visualization'); |
||
| 64 | } |
||
| 65 | if ($table->hasColumn('chart')) { |
||
| 66 | $table->dropColumn('chart'); |
||
| 67 | } |
||
| 68 | |||
| 69 | $table = $schema->getTable('analytics_share'); |
||
| 70 | if (!$table->hasColumn('item_type')) { |
||
| 71 | $table->addColumn('item_type', 'string', [ |
||
| 72 | 'notnull' => true, |
||
| 73 | 'length' => 64, |
||
| 74 | ]); |
||
| 75 | } |
||
| 76 | if (!$table->hasColumn('item_source')) { |
||
| 77 | $table->addColumn('item_source', 'integer', [ |
||
| 78 | 'notnull' => false, |
||
| 79 | ]); |
||
| 80 | } |
||
| 81 | return $schema; |
||
| 82 | } |
||
| 112 | } |
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