| Conditions | 2 |
| Paths | 2 |
| Total Lines | 38 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | public function resetSequences(): int |
||
| 17 | { |
||
| 18 | $connection = $this->entityManager->getConnection(); |
||
| 19 | |||
| 20 | $result = $connection->executeQuery( |
||
| 21 | "SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| ', |
||
| 22 | (SELECT COALESCE(MAX(' ||quote_ident(C.attname)|| '), 1) |
||
| 23 | FROM ' ||quote_ident(T.relname) || '));' |
||
| 24 | FROM pg_class S |
||
| 25 | JOIN pg_depend D |
||
| 26 | ON S.oid = D.objid |
||
| 27 | JOIN pg_class T |
||
| 28 | ON D.refobjid = T.oid |
||
| 29 | JOIN pg_attribute C |
||
| 30 | ON D.refobjid = C.attrelid |
||
| 31 | AND D.refobjsubid = C.attnum |
||
| 32 | WHERE S.relkind = 'S' |
||
| 33 | ORDER BY S.relname" |
||
| 34 | ); |
||
| 35 | |||
| 36 | $count = 0; |
||
| 37 | |||
| 38 | while ($query = $result->fetchOne()) { |
||
| 39 | $connection->executeQuery( |
||
| 40 | $query |
||
| 41 | ); |
||
| 42 | |||
| 43 | $count++; |
||
| 44 | } |
||
| 45 | |||
| 46 | $connection->executeQuery( |
||
| 47 | sprintf( |
||
| 48 | "SELECT SETVAL('stu_user_id_seq', %d)", |
||
| 49 | UserEnum::USER_FIRST_ID |
||
| 50 | ) |
||
| 51 | ); |
||
| 52 | |||
| 53 | return $count; |
||
| 54 | } |
||
| 56 |
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