pub struct HealthFinding {
pub violation: ComplexityViolation,
pub actions: Vec<HealthFindingAction>,
pub introduced: Option<bool>,
pub attribution: Option<AuditFindingAttribution>,
pub worsened_metrics: Vec<WorsenedMetric>,
pub gate_exemption: Option<AuditGateExemption>,
}Expand description
Wire envelope for a single complexity finding.
Fields§
§violation: ComplexityViolationInner complexity-violation payload.
actions: Vec<HealthFindingAction>Machine-actionable fix and suppress hints.
introduced: Option<bool>Audit-mode flag indicating whether the finding is new versus the base snapshot. A complexity finding is new when no base finding has the same path and function name, when a grown metric exceeds a threshold that the base finding did not exceed, or when the growth of an exceeded metric moves it to a higher severity tier. A CRAP score from estimated coverage, or a CRAP score that the base finding does not have, is not growth.
attribution: Option<AuditFindingAttribution>Audit-mode class of the finding against the base snapshot:
introduced, worsened or inherited. A worsened finding matches a
base finding, is not introduced, and has a higher value in at least one
measured metric. Absent outside an audit with a base snapshot.
worsened_metrics: Vec<WorsenedMetric>Audit-mode list of the measured metrics that are higher than in the matched base finding, with the base value and the head value. Present on a worsened finding, and on an introduced finding that matches a base finding. Absent when no metric grew.
gate_exemption: Option<AuditGateExemption>Audit-mode reason why the finding does not gate the verdict. With
test-file, the finding is in a test file and effective_severity is
warn. Absent outside audit, and on a finding that gates.
Implementations§
Source§impl HealthFinding
impl HealthFinding
Sourcepub fn new(
violation: ComplexityViolation,
actions: Vec<HealthFindingAction>,
introduced: Option<bool>,
) -> Self
pub fn new( violation: ComplexityViolation, actions: Vec<HealthFindingAction>, introduced: Option<bool>, ) -> Self
Construct a wrapper around a pre-computed action list.
Sourcepub fn with_actions(
violation: ComplexityViolation,
ctx: &HealthActionContext,
) -> Self
pub fn with_actions( violation: ComplexityViolation, ctx: &HealthActionContext, ) -> Self
Construct a wrapper with actions computed from the finding and
report-wide context.
Methods from Deref<Target = ComplexityViolation>§
Sourcepub fn blocks(&self) -> bool
pub fn blocks(&self) -> bool
Whether the finding fails the run.
A warn gate severity does not block. A finding without the field, for
example from an older saved report, blocks as before.
Sourcepub fn resolved_thresholds(
&self,
summary: &HealthSummary,
) -> HealthEffectiveThresholds
pub fn resolved_thresholds( &self, summary: &HealthSummary, ) -> HealthEffectiveThresholds
Ceilings this finding was actually evaluated against: the per-file
thresholdOverrides result when an override matched, otherwise the
run’s global summary ceilings.
Every renderer that prints or compares a threshold must go through this so a finding is never described against a ceiling it was not measured with.
Trait Implementations§
Source§impl Clone for HealthFinding
impl Clone for HealthFinding
Source§impl Debug for HealthFinding
impl Debug for HealthFinding
Source§impl Deref for HealthFinding
impl Deref for HealthFinding
Source§impl<'de> Deserialize<'de> for HealthFinding
impl<'de> Deserialize<'de> for HealthFinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ComplexityViolation> for HealthFinding
impl From<ComplexityViolation> for HealthFinding
Source§fn from(violation: ComplexityViolation) -> Self
fn from(violation: ComplexityViolation) -> Self
Wrap a violation with empty actions and no introduced flag.