A Swift tool that detects unused code like classes, structs, and functions using IndexStoreDB and SwiftSyntax.
Pecker is a command-line tool that detects unused code in Swift projects, such as classes, structs, enums, protocols, and functions. It helps developers identify and remove dead code to keep their codebases clean and maintainable as they grow. The tool uses IndexStoreDB for indexing and SwiftSyntax for parsing Swift code to ensure accurate detection.
Swift developers working on iOS, macOS, or other Swift projects who need to manage codebase size and maintainability, particularly in larger or long-running projects.
Developers choose Pecker for its precise detection of unused Swift code, seamless Xcode integration, and configurable rules that adapt to different project structures. It's an open-source alternative to manual code reviews or proprietary tools, offering flexibility and transparency.
CodePecker is a tool to detect unused Swift 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.
Leverages IndexStoreDB and SwiftSyntax for fast and precise analysis, ensuring reliable identification of unused Swift constructs like classes and functions.
Provides warnings directly in Xcode via run script phases, making it easy to incorporate into existing iOS/macOS development workflows.
Offers configurable rules such as skip_public and xctest, allowing customization through a .pecker.yml file to adapt to different project structures.
Available via Homebrew, CocoaPods, Mint, or source compilation, catering to various setup preferences and environments.
Requires manual specification of the index store path in terminal mode, as noted in the README, which adds complexity and potential for errors.
Only five rules are configurable, with others like override and extensions fixed, restricting fine-tuning for advanced use cases.
The README warns about SwiftSyntax problems, such as dyld errors with Swift 5.1, leading to setup hurdles and version dependencies.