Dev builds dead code tool with a third state: 'I don't understand this yet'
A developer created a cross-language dead code analysis tool that introduces a third classification state — 'unresolved' — instead of forcing every statement into a binary alive-or-dead verdict. The tool splits codebases into individually numbered statements across Python, TypeScript, JavaScript, and CSS simultaneously, allowing it to detect cross-language references that single-language tools miss entirely. A key safeguard prevents any runtime-assembled name, such as dynamic class lookups or string-concatenated identifiers, from being incorrectly flagged as unused — a flaw that causes other tools to delete live code. Applied to a real project, the tool identified 121 dead statements while also rescuing five style rules that a conventional name-search approach would have wrongly deleted. The developer also highlighted a reliability concern: running the same analysis with two different AI models produced results of 121 versus 55 dead statements, with one model silently inventing its own rule, and the two reports were indistinguishable in appearance.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in