| Conditions | 4 |
| Paths | 8 |
| Total Lines | 94 |
| Code Lines | 64 |
| 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 |
||
| 54 | public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) |
||
| 55 | { |
||
| 56 | /** @var ISchemaWrapper $schema */ |
||
| 57 | $schema = $schemaClosure(); |
||
| 58 | |||
| 59 | if (!$schema->hasTable('analytics_report')) { |
||
| 60 | $table = $schema->createTable('analytics_report'); |
||
| 61 | $table->addColumn('id', 'integer', [ |
||
| 62 | 'autoincrement' => true, |
||
| 63 | 'notnull' => true, |
||
| 64 | ]); |
||
| 65 | $table->addColumn('user_id', 'string', [ |
||
| 66 | 'notnull' => true, |
||
| 67 | 'length' => 64, |
||
| 68 | ]); |
||
| 69 | $table->addColumn('dataset', 'integer', [ |
||
| 70 | 'notnull' => true, |
||
| 71 | ]); |
||
| 72 | $table->addColumn('name', 'string', [ |
||
| 73 | 'notnull' => true, |
||
| 74 | 'length' => 64, |
||
| 75 | ]); |
||
| 76 | $table->addColumn('subheader', 'string', [ |
||
| 77 | 'notnull' => false, |
||
| 78 | 'length' => 256, |
||
| 79 | ]); |
||
| 80 | $table->addColumn('type', 'integer', [ |
||
| 81 | 'notnull' => false, |
||
| 82 | ]); |
||
| 83 | $table->addColumn('link', 'string', [ |
||
| 84 | 'notnull' => false, |
||
| 85 | 'length' => 500, |
||
| 86 | ]); |
||
| 87 | $table->addColumn('visualization', 'string', [ |
||
| 88 | 'notnull' => false, |
||
| 89 | 'length' => 10, |
||
| 90 | ]); |
||
| 91 | $table->addColumn('chart', 'string', [ |
||
| 92 | 'notnull' => false, |
||
| 93 | 'length' => 256, |
||
| 94 | ]); |
||
| 95 | $table->addColumn('parent', 'integer', [ |
||
| 96 | 'notnull' => false, |
||
| 97 | ]); |
||
| 98 | $table->addColumn('dimension1', 'string', [ |
||
| 99 | 'notnull' => false, |
||
| 100 | 'length' => 64, |
||
| 101 | ]); |
||
| 102 | $table->addColumn('dimension2', 'string', [ |
||
| 103 | 'notnull' => false, |
||
| 104 | 'length' => 64, |
||
| 105 | ]); |
||
| 106 | $table->addColumn('dimension3', 'string', [ |
||
| 107 | 'notnull' => false, |
||
| 108 | 'length' => 64, |
||
| 109 | ]); |
||
| 110 | $table->addColumn('value', 'string', [ |
||
| 111 | 'notnull' => false, |
||
| 112 | 'length' => 64, |
||
| 113 | ]); |
||
| 114 | $table->addColumn('chartoptions', 'string', [ |
||
| 115 | 'notnull' => false, |
||
| 116 | 'length' => 1000, |
||
| 117 | ]); |
||
| 118 | $table->addColumn('dataoptions', 'string', [ |
||
| 119 | 'notnull' => false, |
||
| 120 | 'length' => 1000, |
||
| 121 | ]); |
||
| 122 | $table->addColumn('filteroptions', 'string', [ |
||
| 123 | 'notnull' => false, |
||
| 124 | 'length' => 1000, |
||
| 125 | ]); |
||
| 126 | $table->addColumn('refresh', 'integer', [ |
||
| 127 | 'notnull' => false, |
||
| 128 | ]); |
||
| 129 | $table->setPrimaryKey(['id']); |
||
| 130 | $table->addIndex(['user_id'], 'analytics_report_user_id_idx'); |
||
| 131 | } |
||
| 132 | |||
| 133 | $table = $schema->getTable('analytics_share'); |
||
| 134 | if (!$table->hasColumn('report')) { |
||
| 135 | $table->addColumn('report', 'integer', [ |
||
| 136 | 'notnull' => false, |
||
| 137 | ]); |
||
| 138 | } |
||
| 139 | |||
| 140 | $table = $schema->getTable('analytics_threshold'); |
||
| 141 | if (!$table->hasColumn('report')) { |
||
| 142 | $table->addColumn('report', 'integer', [ |
||
| 143 | 'notnull' => false, |
||
| 144 | ]); |
||
| 145 | } |
||
| 146 | |||
| 147 | return $schema; |
||
| 148 | } |
||
| 297 | } |
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