Every codebase accumulates dead weight over time. Functions get renamed, features get deprecated, and entire modules become orphaned as the project evolvesβbut finding what's actually unused often means manually tracing call graphs or relying on IDE warnings that miss plenty. A new open-source tool called unreached aims to automate this detective work by scanning repositories for code that exists but is never reached.
How Unreached Works
The tool, hosted at github.com/siliroid/unreached, performs static analysis on your codebase to identify unreachable functions, methods, and code paths. Unlike runtime profiling which requires executing tests or applications, unreached analyzes the source directlyβmaking it useful for catching dead code before it ships. The project joins a crowded space of code quality tools, but its focused scope makes it a lightweight option for teams wanting to audit their repositories without heavy IDE integration.
Why Dead Code Matters
Unreachable code isn't just clutterβit creates maintenance burden and potential security surface area. Deprecated functions might still be imported by external consumers, creating unexpected dependencies. Inherited codebases especially suffer from this problem, where original authors' work persists long after their context disappears. Tools like unreached give developers visibility into what they're actually shipping.
Integration Considerations
For teams running CI/CD pipelines, adding unreached to build processes could help prevent dead code accumulation over time. The tool's output can be formatted for integration with code review workflows or project tracking systems. While the project is relatively new and community feedback on Hacker News was minimal at publication time, it's worth monitoring for feature additions like support for additional languages or IDE integrations.
Key Takeaways
- Unreached performs static analysis to find unreachable functions and methods in your codebase
- The tool analyzes source code directly without requiring runtime execution
- Useful for auditing inherited projects or preventing dead code accumulation in active development
- Open-source with the repository hosted on GitHub at github.com/siliroid/unreached
The Bottom Line
Static analysis tools like unreached are essential hygiene for maintainable codebases. If your repo doesn't have some form of dead code detection in its workflow, add itβyou'll thank yourself when you're debugging six months from now and wondering why that function exists.