Stellarion
Tools

stellarion_codebase_health [Pro]

Single-call health dashboard with size metrics, complexity, and a letter grade
This is a Pro tool. Requires a Stellarion Pro license. A 180-day free trial starts automatically.

Returns a comprehensive health dashboard for your entire codebase in a single call. Aggregates size metrics, complexity distributions, test coverage ratios, dependency health, and produces an overall health score (0--100) with a letter grade (A--F) and actionable recommendations.

When to Use

  • At the start of a project to establish a quality baseline
  • In CI pipelines as a quality gate (pass/fail based on threshold)
  • During sprint retrospectives to track quality trends
  • When evaluating whether to adopt or fork an open-source project

Parameters

ParameterTypeRequiredDefaultDescription
thresholdnumberNo60Minimum health score to pass (used for CI gate mode). Score below this value results in a fail status.

Examples

Get a full health report

What's the overall health of this codebase?

Returns the complete dashboard with all metrics, grade, and recommendations.

CI gate check

Run a codebase health check with a passing threshold of 75.

Sets threshold: 75. Returns pass or fail alongside the full report, suitable for CI integration.

Compare before and after refactoring

Run a health check so we can compare after the refactoring sprint.

Captures the current state. Run again after changes to see improvements.

Output Format

The report includes the following sections:

Size Metrics

  • Total files, functions, and classes — broken down by language
  • Lines of code per language

Complexity Distribution

  • Cyclomatic complexity histogram (low / moderate / high / very high)
  • Cognitive complexity histogram
  • Top 10 complexity hotspots with file paths and scores

Test Coverage

  • Test-to-code ratio (number of test functions vs. non-test functions)
  • Modules with no test coverage

Dependency Health

  • Circular dependency count and locations
  • Modules with highest fan-out (most outgoing dependencies)
  • Orphan modules (no incoming or outgoing dependencies)

Overall Score

  • Health score — 0 to 100
  • Grade — A (90--100), B (80--89), C (70--79), D (60--69), F (< 60)
  • Pass/Fail — based on the threshold parameter
  • Recommendations — prioritized list of improvements

Tips

  • A score of 60--70 is typical for mature, actively developed projects — do not chase 100
  • The top 10 hotspots list is the most actionable output — start refactoring there
  • Use the test coverage ratio as a directional signal, not an absolute measurement (it counts test functions, not line coverage)
  • For CI gates, start with a threshold of 60 and raise it gradually as the codebase improves
  • Pair with stellarion_tech_debt_report for a detailed breakdown of what is dragging the score down
  • Run periodically (e.g., weekly) and compare grades to catch quality regressions early