A Leiningen plugin for static analysis to find unused code in Clojure applications and libraries.
Yagni is a Leiningen plugin for Clojure that performs static code analysis to find and report dead code in applications and libraries. It helps developers maintain cleaner codebases by identifying unused vars and Java classes that are no longer reachable from project entrypoints.
Clojure developers working on applications or libraries who want to keep their codebases clean and free of unused code, particularly those using Leiningen as their build tool.
Yagni provides a simple, integrated way to detect dead code in Clojure projects without manual inspection, supporting both Leiningen and deps.edn workflows with configurable entrypoints for different project structures.
A Leiningen plugin for finding dead code
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses graph-based analysis to build a reference graph from entrypoints, ensuring precise identification of unused vars and Java classes, as described in the README's background section.
Supports custom entrypoints via a .lein-yagni file, making it suitable for libraries and multi-main applications where default :main isn't sufficient, per the configuration details.
Runs seamlessly as a Leiningen plugin with 'lein yagni' and can be set up with deps.edn aliases, as shown in the installation and usage sections for flexible workflows.
Embraces the YAGNI principle to encourage lean codebases, helping developers proactively eliminate unnecessary code, aligning with the project's stated philosophy.
Requires creating and maintaining a .lein-yagni file for non-standard projects, which adds setup complexity and can lead to errors if entrypoints are misconfigured.
Cannot detect dead code that is referenced dynamically or via reflection, potentially missing unused code in applications with complex runtime behavior.
Only warns about dead code without providing options to automatically delete it, leaving cleanup as a manual and potentially time-consuming task for developers.