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

FactorWeightWhat it measures
Dead code25%Unreachable functions via call graph BFS
Dependencies25%Missing or unused pip packages
Duplication25%Structurally identical code blocks
Architecture25%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 80

CI/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 80

This 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 --github

GitLab CI

hezgene ci --gitlab
Auto-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 boundaries
Previous
Static vs runtime
Mental model for codebase intelligence
Config file
.hezgene/config.json reference
Next