Title: Work down the Mago lint and analyzer baselines (354 findings) · Issue #13 · php-db/phpdb-pgsql · GitHub
Open Graph Title: Work down the Mago lint and analyzer baselines (354 findings) · Issue #13 · php-db/phpdb-pgsql
X Title: Work down the Mago lint and analyzer baselines (354 findings) · Issue #13 · php-db/phpdb-pgsql
Description: Summary Tracks working down the mago baselines added in #11: 123 linter findings in lint-baseline.toml, 231 analyzer findings in analyzer-baseline.toml. New findings in new code already fail, so this is about ratcheting the recorded ones...
Open Graph Description: Summary Tracks working down the mago baselines added in #11: 123 linter findings in lint-baseline.toml, 231 analyzer findings in analyzer-baseline.toml. New findings in new code already fail, so th...
X Description: Summary Tracks working down the mago baselines added in #11: 123 linter findings in lint-baseline.toml, 231 analyzer findings in analyzer-baseline.toml. New findings in new code already fail, so th...
Opengraph URL: https://github.com/php-db/phpdb-pgsql/issues/13
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Work down the Mago lint and analyzer baselines (354 findings)","articleBody":"## Summary\n\nTracks working down the mago baselines added in #11: 123 linter findings in `lint-baseline.toml`, 231 analyzer findings in `analyzer-baseline.toml`. New findings in new code already fail, so this is about ratcheting the recorded ones back to zero.\n\nPer batch: fix a group, regenerate with `mago lint --baseline lint-baseline.toml --generate-baseline` or the `analyze` equivalent, check the count dropped and nothing new appeared, open a PR. The groups are independent.\n\n## Distribution\n\nFour files hold 60% of the total, so the analyzer groups are better done per file than per rule.\n\n- `src/Metadata/Source.php` — 99\n- `src/Connection.php` — 51\n- `src/Pdo/Connection.php` — 39\n- `src/Statement.php` — 18\n- `src/Driver.php` — 13\n- `src/AdapterPlatform.php` — 12\n\n## Linter, 123\n\n- Test conventions, 45, test-only — `assertion-style` 30, `prefer-test-attribute` 13, `strict-assertions` 2, across six test files. Mostly `mago lint --fix --potentially-unsafe`, though the `#[Test]` method renames want reading.\n- `no-isset` 13 — `src/Pdo/Connection.php` 7, `src/Metadata/Source.php` 5, `src/Statement.php` 1. Semantic where absent and null differ.\n- `literal-named-argument` 14 — 12 in `src`, 2 in tests, three files.\n- `tagged-todo` 10 — nine files, needs `(@user)` or `(#issue)`.\n- Remainder 41 — `no-else-clause` 7, `string-style` 5, `no-multi-assignments` 4, `cyclomatic-complexity` 3, `halstead` 3, `no-empty` 3, `kan-defect` 2, `no-literal-password` 2, `no-dead-store` 2, `no-literal-namespace-string` 2, `prefer-arrow-function` 2, six singletons. The two `no-literal-password` are both in `src/ConfigProvider.php` and look like default config keys. `cyclomatic-complexity`, `halstead` and `kan-defect` sit in the same files as the analyzer work and should follow it.\n\n## Analyzer, 231\n\n- `src/Metadata/Source.php` 99 — all 28 `invalid-array-access`, 23 of the 25 `possibly-undefined-string-array-index`, all 7 `reference-constraint-violation`, all 4 `too-many-arguments`, 5 `unhandled-thrown-type`. Untyped array plumbing over `information_schema`; wants array shapes or DTOs for the metadata rows.\n- `unhandled-thrown-type` 25 — `src/Connection.php` 6, `src/Metadata/Source.php` 5, `src/Container/PdoDriverInterfaceFactory.php` 4, `src/Container/DriverInterfaceFactory.php` 3, `src/Pdo/Connection.php` 3, `src/Container/PdoConnectionInterfaceFactory.php` 2, `src/Driver.php` 2. `@throws` under `check-throws`. A driver-level exception that belongs in the shared `unchecked-exceptions` allowlist is a `phpdb-qa-tools` PR, not a local fix.\n- Mixed and imprecise typing 51 — `imprecise-type` 16 over thirteen files, `mixed-argument` 14, `mixed-assignment` 12, `mixed-array-assignment` 7, `mixed-return-statement` 4, `mixed-property-type-coercion` 1. Largely covered by the `Source.php` work.\n- Nullability and invalid values 32 — `possibly-null-argument` 9, `possibly-invalid-argument` 7, `invalid-property-assignment-value` 4, `possibly-null-operand` 3, `invalid-argument` 3, `invalid-return-statement` 3, `possibly-null-array-access` 2, `possible-method-access-on-null` 2, `possibly-false-argument` 2, `nullable-return-statement` 1. Defects rather than missing annotations, for the most part.\n- Class and property contracts 27 — `uninitialized-property` 9 (5 src, 4 test), `unused-parameter` 9, `class-must-be-final` 7, `missing-constructor` 1, `missing-override-attribute` 1. `enforce-class-finality` with `require-api-or-internal` means `AdapterPlatform`, `Connection`, `Metadata\\Source`, `Pdo\\Connection`, `Pdo\\Driver`, `Result` and `Statement` each have to be `final`, `abstract` or `@api`. For a 0.x driver that is a policy call to settle across the driver packages, not here.\n- Redundancy and impossible conditions 14 — `redundant-condition` 4, `docblock-type-mismatch` 3, `less-specific-argument` 3, `impossible-condition` 2, `impossible-type-comparison` 2, `invalid-type-cast` 2, singletons. The `impossible-condition`, `impossible-type-comparison` and `non-existent-method` entries look like bugs or dead code.\n\n## Order\n\n1. Test conventions.\n2. The impossible and non-existent entries.\n3. Nullability.\n4. `src/Metadata/Source.php`, which covers much of the typing, `no-isset` and complexity work.\n5. `unhandled-thrown-type`.\n6. `class-must-be-final`, after the finality decision.\n7. The complexity rules.\n\n## Related\n\n#10, #11. #12 touches `src/Result.php`, which also carries a `class-must-be-final` entry.\n","author":{"url":"https://github.com/simon-mundy","@type":"Person","name":"simon-mundy"},"datePublished":"2026-08-24T05:20:59Z","url":"https://github.com/php-db/phpdb-pgsql/issues/13"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3437a6fc-7657-7e33-3ab1-dfb064e24a68 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88E6:1065AC:69203:930AC:6AFD6776 |
| html-safe-nonce | ab89a268d26080069f1582694fb7ae20b13fe67e46c5685fa78a81c793459ad3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEU2OjEwNjVBQzo2OTIwMzo5MzBBQzo2QUZENjc3NiIsInZpc2l0b3JfaWQiOiIyOTY1ODI3NzAwMjU5NjQ1MzAyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dc663bf6ce62990290bcb5a869d10621c38f778f26876ba5cc7342c2a28b074e |
| hovercard-subject-tag | issue:5231379413 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/php-db/phpdb-pgsql/13/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5320ad86a52d815431d7bb73d3016a4d24f74b8536e24f553df84f377bfb7b80/php-db/phpdb-pgsql/issues/13 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5320ad86a52d815431d7bb73d3016a4d24f74b8536e24f553df84f377bfb7b80/php-db/phpdb-pgsql/issues/13 |
| og:image:alt | Summary Tracks working down the mago baselines added in #11: 123 linter findings in lint-baseline.toml, 231 analyzer findings in analyzer-baseline.toml. New findings in new code already fail, so th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | simon-mundy |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42a67d7c7488271ca8d7e6dc3942424e6de3bff43b1ed4a9c6f0e1a69b73b389 |
| turbo-cache-control | no-preview |
| go-import | github.com/php-db/phpdb-pgsql git https://github.com/php-db/phpdb-pgsql.git |
| octolytics-dimension-user_id | 219474457 |
| octolytics-dimension-user_login | php-db |
| octolytics-dimension-repository_id | 946781573 |
| octolytics-dimension-repository_nwo | php-db/phpdb-pgsql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 946781573 |
| octolytics-dimension-repository_network_root_nwo | php-db/phpdb-pgsql |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5c3779ac05f3590d8d7ea0c02b14e678ae8179ae |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width