pub struct ThresholdOverrideState {
pub status: ThresholdOverrideStatus,
pub override_index: usize,
pub dimension: ThresholdOverrideDimension,
pub outstanding: Vec<ThresholdOverrideDimension>,
pub path: Option<PathBuf>,
pub function: Option<String>,
pub line: Option<u32>,
pub col: Option<u32>,
pub configured_thresholds: HealthConfiguredThresholds,
pub effective_thresholds: HealthEffectiveThresholds,
pub metrics: Option<ThresholdOverrideMetrics>,
pub reason: Option<String>,
}Expand description
Report entry describing whether a threshold override is active, stale, or no longer matching any analyzed file or function.
Fields§
§status: ThresholdOverrideStatusLifecycle state of the override.
override_index: usizeIndex of the entry in the configured thresholdOverrides array.
Several rows can share one index when the override participates in more
than one dimension; group on this to count configured overrides.
dimension: ThresholdOverrideDimensionThreshold dimension this row describes.
outstanding: Vec<ThresholdOverrideDimension>Dimensions the matched unit still breaches despite this override,
whether or not this override configures their ceilings. Non-empty means
raising the ceiling did not settle the matter: a complexity or CRAP
finding survived, or the unit is still longer than the resolved
maxUnitSize, which keeps it in the large-function list without
emitting a finding of its own.
path: Option<PathBuf>Matched file path, when the override matched one.
function: Option<String>Matched function name, for function-scoped overrides.
line: Option<u32>1-based line of the matched unit. Absent on no_match rows, which
describe an entry that matched nothing. Name alone is not an identity:
one file can hold several units sharing a name, so this pairs with
col to keep their rows distinct (issue #2163).
col: Option<u32>0-based byte column of the matched unit. Absent on no_match rows.
configured_thresholds: HealthConfiguredThresholdsCeilings the override entry configures.
effective_thresholds: HealthEffectiveThresholdsCeilings in effect after applying the override to the defaults.
metrics: Option<ThresholdOverrideMetrics>Current complexity metrics of the matched code, when matched.
reason: Option<String>Human-readable explanation of the status.
Implementations§
Source§impl ThresholdOverrideState
impl ThresholdOverrideState
Sourcepub fn target_label(&self, display: &str) -> String
pub fn target_label(&self, display: &str) -> String
Render the matched unit as path:line:function, given the path already
formatted for the target surface.
Every renderer must go through this: two units sharing a name in one file produce two rows, and without the position they print as the same line (issue #2163).