Skip to main content

Module threshold

Module threshold 

Source

Structs§

ThresholdConfig
Threshold configuration with optional per-path overrides.
ThresholdOverride
A glob-based threshold override for a specific path pattern.

Enums§

ThresholdPreset
Named threshold preset — a calibration tier, independent of metric. The concrete f64 cutoff is resolved per metric via ThresholdPreset::threshold (the same tier maps to a different number for cyclomatic vs cognitive scores).

Constants§

DEFAULT_THRESHOLD
Default CRAP cutoff for the cognitive metric — gates at the Acceptable → Moderate risk boundary; the balanced tier for typical codebases. Cyclomatic equivalent: DEFAULT_THRESHOLD_CYCLOMATIC.
DEFAULT_THRESHOLD_CYCLOMATIC
Default CRAP cutoff for the cyclomatic metric. Currently flat- equal to the cognitive default; see column note above.
LENIENT_THRESHOLD
Lenient CRAP cutoff for the cognitive metric — gates at the Moderate → High risk boundary; for legacy or transitional code. Cyclomatic equivalent: LENIENT_THRESHOLD_CYCLOMATIC.
LENIENT_THRESHOLD_CYCLOMATIC
Lenient CRAP cutoff for the cyclomatic metric. Currently flat- equal to the cognitive lenient; see column note above.
STRICT_THRESHOLD
Strict CRAP cutoff for the cognitive metric — gates at the Low → Acceptable risk boundary; for high-quality or safety-critical code. Cyclomatic equivalent: STRICT_THRESHOLD_CYCLOMATIC.
STRICT_THRESHOLD_CYCLOMATIC
Strict CRAP cutoff for the cyclomatic metric. Currently flat- equal to the cognitive strict value; the constant is retained so a future per-metric recalibration is a one-line change.

Functions§

is_valid_threshold
Returns true if the value is a valid CRAP threshold (finite and positive).