SShortSingh.
Back to feed

Dev builds dead code tool with a third state: 'I don't understand this yet'

0
·1 views

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.

Read the full story at DEV Community

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

Related stories

0
ProgrammingDEV Community ·

Rails 8 Upgrade Cuts Response Times 18% and Eliminates Redis Dependency

A development team migrated a mid-sized application from Rails 7 to Rails 8 and documented concrete performance improvements across multiple areas. Rails 8's Solid Queue, Solid Cache, and Solid Cable allowed the team to replace Redis and Sidekiq with database-backed alternatives, reducing infrastructure costs and operational complexity. The upgrade delivered roughly 18% faster average response times, 25% higher background job throughput, and a 15% reduction in CI pipeline duration. Asset pipeline changes via Propshaft and import maps also cut deployment compile times, while tighter Kamal 2 integration simplified zero-downtime releases. The team noted the migration required significant effort, especially around Solid Queue adoption and deprecated API audits, but concluded the gains justified the investment.

0
ProgrammingHacker News ·

Concerns Grow Over US Fiscal Solvency Amid Rising Debt Worries

Growing concerns about the United States' long-term fiscal health have been gaining attention among investors and analysts. Questions are being raised about America's ability to manage its mounting national debt obligations. The discussion has surfaced in financial media, including coverage by the Financial Times. Analysts are examining whether current debt trajectories pose a credible risk to US solvency. The topic has sparked debate among economists and market observers about the country's financial stability.

0
ProgrammingDEV Community ·

Developer Builds AI-Readable Knowledge Base Using Obsidian and Git, No RAG Pipeline Needed

A developer at NEXT4I built a structured knowledge-base system using Obsidian, Git, and VS Code to solve the problem of documentation scattered across Google Docs, Trello, Apple Notes, and multiple code repositories. The system relies entirely on plain Markdown files organized into folders covering infrastructure, platform design, principles, and other domains. Because an Obsidian vault is simply a folder of .md files, the VS Code AI agent can read it natively without any custom integration, vector database, or embedding pipeline. Version control is handled by initializing a Git repository inside the vault, enabling full decision history and audit trails via a private GitHub repo. The approach was guided by three criteria: zero vendor lock-in, offline and online accessibility, and AI-readability without additional infrastructure.

0
ProgrammingDEV Community ·

Verbose Agent Logs Are Not Audit Trails Without Evidence Contracts and Tests

AI agent runtimes can generate thousands of log lines yet still fail to answer what actions were actually taken after a failure, making true audit trails distinct from verbose logging. A reliable audit trail requires append-only events with stable run IDs, monotonically increasing sequence numbers, and a hash chain that makes tampering or omission detectable. Sensitive data such as tokens, credentials, and raw prompts must be redacted at write time rather than filtered later in a dashboard query. Each externally visible tool call should progress through defined states — from intent recorded through dispatch to confirmed or unknown outcome — with stable request keys to prevent duplicate effects during retries. The test suite must actively mutate the ledger and confirm the verifier rejects deleted, reordered, or forged records, ensuring the system fails closed rather than silently accepting corrupted evidence.

Dev builds dead code tool with a third state: 'I don't understand this yet' · ShortSingh