GRIT is a cli tool that helps developers understand their codebase maintainability index through calculated key metrics: code churn, code complexity and test coverage. Use calculated maintainability index to make decisions about refactoring and testing priorities.
- Code Churn: Tracks how frequently files change over time.
- Code Complexity: Calculates cyclomatic complexity metric per file.
- Test Coverage: Analyzes test coverage percentage per file.
- Visual Analytics: Generates churn vs complexity graphs.
All these metrics are useful when making decisions about:
- Best file candidates for refactoring efforts
- Best file candidates for unit tests coverage
- Best file candidates for code complexity reduction
Install via tool via go install
command:
go install github.com/vbvictor/grit@latest
Or Download the latest binary release from Github Releases page.
Run grit -h
to check out all available commands and general help for grit
:
GRIT is an all-in-one cli tool that helps developers understand
their codebase maintainability index through calculated metrics.
Usage:
grit [command]
Available Commands:
help Help about any command
stat Calculate code metrics
Flags:
-h, --help help for grit
Use "grit [command] --help" for more information about a command.
Each command has its own extensive description that can be accessed by running grit [command] -h
.
- Features
- collect churn, complexity, coverage metrics
- create maintainability report
- render churn vs complexity graph
- render churn vs complexity vs coverage graph
- add more output formats
- support custom files with metrics to supporting other languages
- Improvements
- enhance readme with more examples and metric descriptions
- use different library for formatting tabular output
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.