Health Score
The Health Score is a single number (0–100) that represents the overall quality of your codebase. It combines dead code detection, dependency hygiene, code duplication, and architecture boundary analysis into one actionable metric.
How it is calculated
| Factor | Weight | What it measures |
|---|---|---|
| Dead code | 25% | Unreachable functions via call graph BFS |
| Dependencies | 25% | Missing or unused pip packages |
| Duplication | 25% | Structurally identical code blocks |
| Architecture | 25% | Layer boundary violations |
Commands
# View the health score
hezgene health
# Run a full audit with auto-fix
hezgene audit --apply
# Git-aware PR risk check
hezgene audit --min-score 80CI/CD integration
The health score is designed for CI/CD pipelines. Set a minimum threshold and fail PRs that degrade your codebase:
hezgene audit --min-score 80This command compares the health of the current branch against the main branch and fails with exit code 1 if the score drops below the threshold.
GitHub Actions
hezgene ci --githubGitLab CI
hezgene ci --gitlabAuto-fix everything
Running
hezgene audit --apply will automatically delete dead code, remove unused dependencies, and report duplication families — all in one command.Individual scanners
You can also run each scanner independently:
# Find and delete unreachable code
hezgene dead-code --apply
# Find structural code clones
hezgene dupes
# Find and remove unused dependencies
hezgene deps --apply
# Enforce architecture layers
hezgene boundariesWas this page helpful?