pub struct Finding {Show 16 fields
pub id: String,
pub rule_id: String,
pub message: String,
pub severity: Severity,
pub location: SourceLocation,
pub language: Language,
pub snippet: Option<String>,
pub suggestion: Option<String>,
pub fix: Option<Fix>,
pub confidence: Confidence,
pub category: FindingCategory,
pub source: FindingSource,
pub fingerprint: Option<String>,
pub properties: Option<HashMap<String, Value>>,
pub occurrence_count: Option<usize>,
pub additional_locations: Option<Vec<usize>>,
}Expand description
A security or code quality finding
Fields§
§id: String§rule_id: String§message: String§severity: Severity§location: SourceLocation§language: Language§snippet: Option<String>§suggestion: Option<String>§fix: Option<Fix>Structured fix for auto-fix with precise byte offsets
confidence: ConfidenceConfidence level (how certain we are this is a real issue)
category: FindingCategoryCategory of finding (security, quality, performance, style)
source: FindingSourceSource engine that produced this finding
fingerprint: Option<String>Stable fingerprint for baseline comparison (sha256 hash)
properties: Option<HashMap<String, Value>>Additional properties (e.g., import_hits, import_files_sample for OSV findings)
occurrence_count: Option<usize>Number of occurrences when deduplicated (same rule in same file) None or 1 means single occurrence, >1 means multiple occurrences consolidated
additional_locations: Option<Vec<usize>>Additional line numbers when occurrence_count > 1
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn compute_fingerprint(&mut self)
pub fn compute_fingerprint(&mut self)
Compute a stable fingerprint for this finding Based on: rule_id + relative path + normalized snippet
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Finding
impl<'de> Deserialize<'de> for Finding
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnwindSafe for Finding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more