Conversation
- Extract decorators/annotations from AST into node.extra["decorators"] for Python, Java/Kotlin/C#, and TypeScript - Expand framework decorator patterns from 8 to 24 (pytest, Django, Spring, Celery, NestJS, pydantic-ai agent tools, etc.) - Exclude dunder methods from dead code results - Skip classes referenced in function type annotations (Pydantic schemas) - Per-symbol IMPORTS_FROM edges for JS/TS/TSX named imports -- eliminates ~320 FPs from frontend codebases - ORM/framework base class exclusion (Base, DeclarativeBase, BaseModel, BaseSettings, etc.) - New entry point name patterns: upgrade/downgrade (Alembic), lifespan/get_db (FastAPI)
9a17cd9 to
dea608f
Compare
tirth8205
left a comment
There was a problem hiding this comment.
Great improvement to dead code detection accuracy — expanding framework patterns from 8 to 22, excluding dunder methods, and using AST decorators are all valuable. 314 lines of new tests.
Please rebase on latest main. Once rebased and CI passes, we'll review for merge.
Review: PR #104 — fix: reduce dead code false positives (DRAFT)This PR is superseded by PR #158, which incorporates this fix (decorator extraction, expanded framework patterns, dunder exclusion, type annotation reference tracking) and many more improvements from the same author. Recommendation: Close this PR in favor of #158. gzenz confirmed in #103's comments that they consolidated all improvements into one large PR (#158). The owner's review comment also asked for a rebase, which was never done. Note: This PR is still in DRAFT status. |
|
Superseded by #158. |
Summary
node.extra["decorators"]for Python, Java/Kotlin/C#, and TypeScript -- enables framework entry point detection that was previously wired but never populated_FRAMEWORK_DECORATOR_PATTERNSfrom 8 to 22 patterns (pytest fixtures, Django signals, SQLAlchemy events, Celery tasks, Spring annotations, Flask/Starlette middleware, NestJS/Angular decorators)__init__,__str__, etc.) from dead code results -- runtime-invoked, never have explicit callersTest plan