pub struct UnusedClassMemberFinding {
pub member: UnusedMember,
pub actions: Vec<IssueAction>,
pub semantic: Option<SemanticCandidateDecision>,
pub semantic_only_candidate: bool,
pub introduced: Option<AuditIntroduced>,
pub effective_severity: Option<EffectiveSeverity>,
pub reachability_caveats: Vec<ReachabilityCaveat>,
}Expand description
Wire-shape envelope for an UnusedMember finding consumed under the
unused_class_members key. Same Rust struct as
UnusedEnumMemberFinding; the fix action and suppress comment carry
the class-member kebab-case identifier instead.
Fields§
§member: UnusedMemberThe underlying dead-code entry.
actions: Vec<IssueAction>Suggested next steps. Always emitted (possibly empty for forward-compat).
semantic: Option<SemanticCandidateDecision>Type-aware evidence for this exact candidate when requested.
semantic_only_candidate: boolInternal marker for a framework member that the syntactic analysis suppresses, but the semantic pass may promote after proving complete closed-world absence. Never serialized as part of the public finding.
introduced: Option<AuditIntroduced>Set by the audit pass when this finding is introduced relative to the merge-base.
effective_severity: Option<EffectiveSeverity>Gate severity of this finding after rules and overrides[].rules
resolve for its path. CI formats read it for the annotation, SARIF
and CodeClimate level. Absent in output from older versions. Not
part of the finding identity, baseline keys or fingerprints.
reachability_caveats: Vec<ReachabilityCaveat>Advisory caveats on the verdict behind this finding. A class member’s
usage is collected by the same reachability-free member-access walk an
enum member’s is, so it takes the enum-member rule unchanged: any module
this run analyzed incompletely can hold the access that credits it.
Sorted, deduplicated, and omitted from the wire when empty. Never gates
the finding; it does withhold the remove-class-member mutation that
the type-aware pass would otherwise open.
Implementations§
Source§impl UnusedClassMemberFinding
impl UnusedClassMemberFinding
Sourcepub fn with_actions(member: UnusedMember) -> Self
pub fn with_actions(member: UnusedMember) -> Self
Build the wrapper from a raw UnusedMember. Class-member fixes
are not auto-applied (members can be used via dependency injection
or decorators), so auto_fixable is false and a context note is
attached.
Sourcepub const fn semantic_only_candidate(self) -> Self
pub const fn semantic_only_candidate(self) -> Self
Mark this finding as latent until semantic analysis proves that the framework contract does not apply and no static references exist.
Sourcepub fn set_semantic_decision(&mut self, decision: SemanticCandidateDecision)
pub fn set_semantic_decision(&mut self, decision: SemanticCandidateDecision)
Attach the canonical semantic decision and expose the class-member fix only when the API policy granted closed-world eligibility AND this run holds the evidence for the mutation.
This is the one code path that RAISES auto_fixable on a class member,
and it runs in the API layer AFTER the analysis layer stamped the run’s
caveats, so it asks the gate for the same reason
set_export_semantic_action does: a closed-world verdict computed
over a program the run never fully read must not re-open a removal the
incomplete run already withheld. The withheld note names the evidence
gap rather than the semantic explanation, which stays readable on the
finding’s own semantic object.
Trait Implementations§
Source§impl CaveatedFinding for UnusedClassMemberFinding
impl CaveatedFinding for UnusedClassMemberFinding
Source§fn set_reachability_caveats(&mut self, caveats: Vec<ReachabilityCaveat>)
fn set_reachability_caveats(&mut self, caveats: Vec<ReachabilityCaveat>)
caveats and downgrade every mutating action the gate now
withholds. The field itself stays pub (a renderer test builds an
already-caveated fixture directly, without running the annotation
pass); every non-test writer goes through this setter instead of the
field so the downgrade travels with the write.Source§impl Clone for UnusedClassMemberFinding
impl Clone for UnusedClassMemberFinding
Source§impl Debug for UnusedClassMemberFinding
impl Debug for UnusedClassMemberFinding
Source§impl<'de> Deserialize<'de> for UnusedClassMemberFinding
impl<'de> Deserialize<'de> for UnusedClassMemberFinding
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 GatedFinding for UnusedClassMemberFinding
impl GatedFinding for UnusedClassMemberFinding
Source§fn effective_severity(&self) -> Option<EffectiveSeverity>
fn effective_severity(&self) -> Option<EffectiveSeverity>
None when no value was written.