Skip to main content
Raigal assigns each repository a calibrated quality score between 0 and 100. The score measures issue density rather than raw finding counts, preventing large codebases from failing solely due to codebase volume.

Scoring formula

Raigal evaluates findings across six diagnostic engines using density-normalized logarithmic scaling:
Where:
  • Smoothing constant (S): Defaults to 5 in configuration (internal fallback 10). Prevents a single warning on a small project from collapsing the score.
  • Density scale: Multiplier of 5.0 applied to deduction density.
  • Effective source files: Count of non-excluded source and test files in the workspace (or modified files during incremental PR scans).

Severity multipliers and engine weights

Each diagnostic finding generates a raw penalty based on its severity and parent engine:

Severity multipliers

  • error: 3.0 (also triggers immediate exit code 1 in CI)
  • warning: 1.0
  • info: 0.25

Engine weights

  • security: 1.5 (secrets, injections, unsafe APIs, vulnerable dependencies)
  • architecture: 1.0 (module boundary crossings, circular imports)
  • ai-slop: 1.0 (swallowed exceptions, narrative comments, loose type casts)
  • code-quality: 0.8 (dead code, complexity, parameter limits)
  • lint: 0.6 (Oxlint, Ruff, Clippy, Roslynator)
  • format: 0.3 (whitespace, indentation, import ordering)

Dynamic rule capping

To ensure widespread style issues (such as 500 missing trailing commas) do not drown out security vulnerabilities or force score collapse on large projects, rules belong to impact tiers with dynamic baseline caps:

Repository scale scaling

The effective cap scales with repository size:

Worked examples

Example 1: Microservice (10 files, 1 warning)

  • Finding: 1 ai-slop/swallowed-exception (warning, severity 1.0, engine 1.0, tier strict 1.0).
  • Calculation:

Example 2: Monolith (200 files, 500 style findings)

  • Findings: 500 missing trailing commas (format/trailing-comma, info 0.25, engine 0.3, tier style 0.5, cap 8).
  • Calculation:

Score thresholds and status bands

Raigal relies exclusively on numeric 0-100 scores. Letter grades (A-F) are not used.

CLI status labels

When running raigal scan or raigal ci, status labels correspond to score boundaries: In CI environments, raigal ci exits with code 1 if the score is lower than ci.failBelow (default: 70) or if any error-level finding is detected.

Dashboard health bands

The Raigal Cloud web interface (app.raigal.dev) categorizes repositories into calibrated health bands:

Quality gate verdicts (3-state)

PR status checks and CI gates evaluate pull requests into three distinct states: