Skip to content

Remove dead code flagged in the code-quality review (#528)#552

Open
maltehuebner wants to merge 1 commit into
mainfrom
cleanup/code-quality-528
Open

Remove dead code flagged in the code-quality review (#528)#552
maltehuebner wants to merge 1 commit into
mainfrom
cleanup/code-quality-528

Conversation

@maltehuebner

Copy link
Copy Markdown
Contributor

Addresses item 4 (dead/unreachable code) of #528 — the fully verifiable part.

Changes

  • Deleted assets/js/limit-violation.js. It references a global exceedanceData that is defined nowhere, is not a Webpack entry (webpack.config.js) and is rendered by no template. Confirmed by grep across assets/, templates/, config/, webpack.config.js and package.json.
  • Removed StationRepository::findIndexedByProvider. Grep across src/ shows only the definition — no callers, not HTTP-reachable.

Deliberately not implemented / deferred

These three items are behavioural changes on DB/HTTP paths that cannot be exercised or verified in this environment (no PostGIS/Redis, and the local vendor/ lacks symfony/runtime so the kernel cannot boot). Committing them unverified would risk changing API behaviour blindly:

  • N+1 queries in CityController::showAction — consolidating the per-station PollutionDataFactory native queries into one station_id IN (...) query requires DB verification of the grouped result and query-count profiling.
  • Silent UniqueConstraintViolationException suppression in PostgisPersister::persistValues — changing this alters API success/failure semantics (currently returns 200) and needs DB-backed batch-insert testing to get the upsert/clear behaviour right.
  • Missing value validation in PUT /api/value (value bounds, future date_time, tag > 32 chars) — a 400-vs-500 behavioural change on an endpoint that needs a bootable kernel + DB to test end-to-end.

Verification

  • vendor/bin/phpstan analyse --no-progress — No errors
  • vendor/bin/phpunit --testsuite="Project Test Suite" — OK (121 tests)

Refs #528 (partial)

🤖 Generated with Claude Code

…edByProvider

- assets/js/limit-violation.js references an undefined global
  `exceedanceData`, is not a Webpack entry and is rendered by no
  template - dead on arrival. Removed.
- StationRepository::findIndexedByProvider has no callers anywhere in
  src/ and is not HTTP-reachable. Removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant