Files
kochwas/docs/superpowers/review/dead-code.md
hsiegeln 10c43c4d4a
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 31s
docs(review): Deep-Code-Review 2026-04-18
Vier parallele Review-Passes (Dead-Code, Redundanzen, Struktur,
Docs-vs-Code) plus konsolidierter Hauptreport. Nur Dokumentation —
keine Code-Änderungen. Tests 158/158 grün beim Review-Start.

Haupt-Findings:
- ARCHITECTURE.md:55 nennt falsche Tabellennamen
  (recipe_ingredient/recipe_step statt ingredient/step)
- parseId in 9 API-Handlern dupliziert
- Page-Komponenten teils >750 Zeilen
- yauzl installiert aber ungenutzt (für Phase 5b reserviert)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 21:55:41 +02:00

3.4 KiB

Dead-Code Review

Summary

Kochwas codebase is remarkably clean with minimal dead code. Primary finding: yauzl dependency is unused (reserved for future backup-restore feature). All exports are active, files are properly structured, and no unreachable code paths detected.

HIGH confidence findings

Unused Dependencies

  • package.json: yauzl, @types/yauzl — Declared in dependencies but never imported in source code. Added in commit for future backup ZIP import feature (currently only export via archiver is implemented). See docs/superpowers/session-handoff-2026-04-17.md which notes: "Import aus ZIP ist noch manueller DB-Copy. yauzl ist bereits als Dependency da, Phase 5b kann das in 10 Minuten nachziehen."

Exported Types Not Imported Elsewhere

  • src/lib/sw/cache-strategy.ts:3RequestShape — Exported type only used within the same file as a function parameter. Not imported anywhere (type is passed inline at call site in service-worker.ts). Candidates for internal-only marking.
  • src/lib/sw/diff-manifest.ts:4ManifestDiff — Exported type only used within same file as a return type of diffManifest(). Not imported by any other module.

MEDIUM confidence findings

None identified. All functions, types, and stores are actively used. All 85 source files are reachable through proper route conventions (+page.svelte, +server.ts, +layout.svelte are auto-routed by SvelteKit).

LOW confidence / worth double-checking

Conditional Dead Code in Service Worker (Low risk)

  • src/service-worker.ts:99-110 — The GET_VERSION message handler for zombie-SW cleanup is only triggered by pwaStore when specific conditions match (bit-identical versions detected after SKIP_WAITING). Works correctly but only fires on edge-case deployments (Chromium race condition). Verified it's needed—comments explain the scenario thoroughly.

Database Migrations

  • src/lib/server/db/migrations/007-011 — Recent migrations (thumbnail_cache rerun, favicon resets) are cleanup/maintenance operations. Verified they're applied in sequence and read by code (e.g., searxng.ts queries thumbnail_cache). No orphaned migration tables.

Non-findings (places I checked and confirmed alive)

  • All client stores (confirm, install-prompt, network, profile, pwa, search-filter, sync-status, toast, wishlist) — Every export used in components
  • All server repositories (domains, profiles, recipes, wishlist) — All functions imported by API routes
  • All parsers (ingredient, iso8601-duration, json-ld-recipe) — Used by recipe importer and web search
  • All API routes — All 27 route handlers are reachable and handler import the functions they need
  • All Svelte components — No orphaned .svelte files; all imported by routes or other components
  • Static assets (/manifest.webmanifest, /icon.svg, /icon-192.png, /icon-512.png) — Referenced in app.html, cache-strategy.ts, and manifest
  • Service worker — All functions in service-worker.ts are called; no dead branches
  • Commented code — Only legitimate documentation comments (German docs explaining design decisions); no large disabled code blocks

Review Scope: src/ (~85 files), package.json dependencies, tests/ Tools used: Grep (regex + pattern matching), Read (file inspection), Bash (git log) Confidence Threshold: HIGH = 100% sure, MEDIUM = 95%+, LOW = contextual