Repository navigation
Closed
Labels
enhancementNew feature or requestscope:code-intelCode intelligence — indexing, graph, impact analysis
Milestone
Description
Is your feature request related to a problem?
cora dead-code reports 261 symbols on a SvelteKit + Phaser + Rust/Axum project. Manual triage shows ~82% (213/261) are false positives — methods invoked by frameworks via string/attribute registration, not explicit calls. The current skip mechanism (index_skip_files, added in v0.11.1 via #447) is file-level only and cannot suppress individual lifecycle methods without removing all symbols from the file.
Breakdown (261 total)
| Category | Count | Why flagged | Reality |
|---|---|---|---|
Phaser scene methods (create, init, update, preload, *Scene class methods) |
155 | no explicit caller | called by Phaser Scene registry |
Rust route handlers + error mappers (login, me, health_check, submit_progress, bad_request, …) |
41 | no explicit caller | wired in build_router (Axum) |
SvelteKit route exports (load, entries, GET/POST in +page.ts/+server.ts) |
12 | no explicit caller | framework-called |
| Test helpers | 4 | no explicit caller | test runner |
Svelte template-only utils (cn) |
1 | no explicit caller | used inside .svelte markup |
After removing genuinely dead code, only ~48 candidates remained for review.
Current mitigations (insufficient)
--include-tests,--min-lines N— CLI flags only, not persistent.rules_engine.index_skip_files(fix: add skip list for index scanners to reduce false positives on entry-point files #447) — file-level glob, can't target a single method inside a normal source file (skippingularTanggaScene.tsalso hides its real call graph).- Detect HTTP routes as graph symbols #438 (Detect HTTP routes as graph symbols) — will fix the Rust subset once shipped, but not Phaser/SvelteKit lifecycle.
- v0.11.0 — Intelligent Rules (Tier 2) #445 / Epic: Dead Code Detection #426 exclusions cover
main(),#[entry_point], exported functions, tests, trait impls — not framework lifecycle methods.
Proposed
Framework-aware "called by framework" detection, plus a symbol-level escape hatch:
- Phaser: methods on classes extending
Phaser.Scene(create,init,preload,update) → mark as entry points. - SvelteKit: exports of
+page.ts/+layout.ts/+server.ts(load,entries,GET,POST, …) → entry points. - Svelte actions: functions used as
use:fooin.sveltemarkup → recognized as called. - Symbol-level suppression marker (parity with the file-level skip in fix: add skip list for index scanners to reduce false positives on entry-point files #447): support
// cora: keep/// cora:inlinecomments, or reuse Rust's#[allow(dead_code)]/ TS// eslint-disablestyle markers that cora already understands. - Config knob in
rules_engine, e.g.entry_point_methods: ["Phaser.Scene::create", "Phaser.Scene::init", ...]with sensible framework defaults.
Environment
- cora 0.11.1
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestscope:code-intelCode intelligence — indexing, graph, impact analysis
Activity
fix(code-intel): FTS5 search, dead-code false positives, index skip f…