Scoring formula
Raigal evaluates findings across six diagnostic engines using density-normalized logarithmic scaling:- Smoothing constant (
S): Defaults to5in configuration (internal fallback10). Prevents a single warning on a small project from collapsing the score. - Density scale: Multiplier of
5.0applied 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.0info: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, severity1.0, engine1.0, tier strict1.0). - Calculation:
Example 2: Monolith (200 files, 500 style findings)
- Findings: 500 missing trailing commas (
format/trailing-comma,info0.25, engine0.3, tier style0.5, cap8). - 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 runningraigal 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: