Conditions | 1 |
Paths | 1 |
Total Lines | 95 |
Code Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
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 |
||
159 | public function down(Schema $schema) |
||
160 | { |
||
161 | $this->acl->down($schema); |
||
162 | $this->addSql('CREATE TABLE app_anonymous_role_bu (anonymous_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(anonymous_role_id, business_unit_id))'); |
||
163 | $this->addSql('CREATE INDEX IDX_B09CAAD23089E0B ON app_anonymous_role_bu (anonymous_role_id)'); |
||
164 | $this->addSql('CREATE INDEX IDX_B09CAADA58ECB40 ON app_anonymous_role_bu (business_unit_id)'); |
||
165 | $this->addSql('CREATE TABLE app_individual_role_bu (individual_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(individual_role_id, business_unit_id))'); |
||
166 | $this->addSql('CREATE INDEX IDX_68A9160EFDFA321 ON app_individual_role_bu (individual_role_id)'); |
||
167 | $this->addSql('CREATE INDEX IDX_68A9160A58ECB40 ON app_individual_role_bu (business_unit_id)'); |
||
168 | $this->addSql('CREATE TABLE app_organization_role_bu (organization_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(organization_role_id, business_unit_id))'); |
||
169 | $this->addSql('CREATE INDEX IDX_79C5DB011BD1AAEF ON app_organization_role_bu (organization_role_id)'); |
||
170 | $this->addSql('CREATE INDEX IDX_79C5DB01A58ECB40 ON app_organization_role_bu (business_unit_id)'); |
||
171 | $this->addSql('CREATE TABLE app_staff_role_bu (staff_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(staff_role_id, business_unit_id))'); |
||
172 | $this->addSql('CREATE INDEX IDX_998CF18F8AB5351A ON app_staff_role_bu (staff_role_id)'); |
||
173 | $this->addSql('CREATE INDEX IDX_998CF18FA58ECB40 ON app_staff_role_bu (business_unit_id)'); |
||
174 | $this->addSql('CREATE TABLE app_system_role_bu (system_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(system_role_id, business_unit_id))'); |
||
175 | $this->addSql('CREATE INDEX IDX_6CCE35F83A705E3F ON app_system_role_bu (system_role_id)'); |
||
176 | $this->addSql('CREATE INDEX IDX_6CCE35F8A58ECB40 ON app_system_role_bu (business_unit_id)'); |
||
177 | $this->addSql(' |
||
178 | INSERT INTO app_anonymous_role_bu ( |
||
179 | anonymous_role_id, |
||
180 | business_unit_id |
||
181 | ) |
||
182 | SELECT |
||
183 | app_anonymous_role.id, |
||
184 | app_bu.id |
||
185 | FROM |
||
186 | app_anonymous_role, |
||
187 | app_bu |
||
188 | WHERE |
||
189 | app_anonymous_role.entity_uuids::text LIKE CONCAT(\'%\', app_bu.uuid, \'%\') |
||
190 | '); |
||
191 | $this->addSql(' |
||
192 | INSERT INTO app_individual_role_bu ( |
||
193 | individual_role_id, |
||
194 | business_unit_id |
||
195 | ) |
||
196 | SELECT |
||
197 | app_individual_role.id, |
||
198 | app_bu.id |
||
199 | FROM |
||
200 | app_individual_role, |
||
201 | app_bu |
||
202 | WHERE |
||
203 | app_individual_role.entity_uuids::text LIKE CONCAT(\'%\', app_bu.uuid, \'%\') |
||
204 | '); |
||
205 | $this->addSql(' |
||
206 | INSERT INTO app_organization_role_bu ( |
||
207 | organization_role_id, |
||
208 | business_unit_id |
||
209 | ) |
||
210 | SELECT |
||
211 | app_organization_role.id, |
||
212 | app_bu.id |
||
213 | FROM |
||
214 | app_organization_role, |
||
215 | app_bu |
||
216 | WHERE |
||
217 | app_organization_role.entity_uuids::text LIKE CONCAT(\'%\', app_bu.uuid, \'%\') |
||
218 | '); |
||
219 | $this->addSql(' |
||
220 | INSERT INTO app_staff_role_bu ( |
||
221 | staff_role_id, |
||
222 | business_unit_id |
||
223 | ) |
||
224 | SELECT |
||
225 | app_staff_role.id, |
||
226 | app_bu.id |
||
227 | FROM |
||
228 | app_staff_role, |
||
229 | app_bu |
||
230 | WHERE |
||
231 | app_staff_role.entity_uuids::text LIKE CONCAT(\'%\', app_bu.uuid, \'%\') |
||
232 | '); |
||
233 | $this->addSql(' |
||
234 | INSERT INTO app_system_role_bu ( |
||
235 | system_role_id, |
||
236 | business_unit_id |
||
237 | ) |
||
238 | SELECT |
||
239 | app_system_role.id, |
||
240 | app_bu.id |
||
241 | FROM |
||
242 | app_system_role, |
||
243 | app_bu |
||
244 | WHERE |
||
245 | app_system_role.entity_uuids::text LIKE CONCAT(\'%\', app_bu.uuid, \'%\') |
||
246 | '); |
||
247 | $this->addSql('ALTER TABLE app_anonymous_role DROP entity_uuids'); |
||
248 | $this->addSql('ALTER TABLE app_individual_role DROP entity_uuids'); |
||
249 | $this->addSql('ALTER TABLE app_organization_role DROP entity_uuids'); |
||
250 | $this->addSql('ALTER TABLE app_staff_role DROP entity_uuids'); |
||
251 | $this->addSql('ALTER TABLE app_system_role DROP entity_uuids'); |
||
252 | $this->addSql('DROP TABLE app_bu_role'); |
||
253 | $this->addSql('DROP SEQUENCE app_bu_role_id_seq CASCADE'); |
||
254 | } |
||
256 |
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