pub struct Finding {Show 16 fields
pub rule_id: String,
pub rule_name: String,
pub severity: Severity,
pub confidence: Confidence,
pub message: String,
pub function: String,
pub function_signature: String,
pub evidence: Vec<String>,
pub span: Option<SourceSpan>,
pub cwe_ids: Vec<String>,
pub fix_suggestion: Option<String>,
pub code_snippet: Option<String>,
pub exploitability: Exploitability,
pub exploitability_score: f32,
pub code_context: CodeContext,
pub filter_reason: Option<String>,
}Fields§
§rule_id: String§rule_name: String§severity: Severity§confidence: ConfidenceConfidence level of this specific finding
message: String§function: String§function_signature: String§evidence: Vec<String>§span: Option<SourceSpan>§cwe_ids: Vec<String>CWE identifiers for this finding
fix_suggestion: Option<String>Actionable fix suggestion
code_snippet: Option<String>Code snippet showing the vulnerable code
exploitability: ExploitabilityCVSS-like exploitability metrics
exploitability_score: f32Computed exploitability score (0.0 - 3.9)
code_context: CodeContextCode context where this finding was detected (production, test, example, etc.)
filter_reason: Option<String>Reason for filtering if this finding was excluded from primary results
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn new(
rule_id: impl Into<String>,
rule_name: impl Into<String>,
severity: Severity,
message: impl Into<String>,
function: impl Into<String>,
function_signature: impl Into<String>,
evidence: Vec<String>,
span: Option<SourceSpan>,
) -> Self
pub fn new( rule_id: impl Into<String>, rule_name: impl Into<String>, severity: Severity, message: impl Into<String>, function: impl Into<String>, function_signature: impl Into<String>, evidence: Vec<String>, span: Option<SourceSpan>, ) -> Self
Create a new finding with default confidence and optional fields
Sourcepub fn with_confidence(self, confidence: Confidence) -> Self
pub fn with_confidence(self, confidence: Confidence) -> Self
Set confidence level
Sourcepub fn with_snippet(self, snippet: impl Into<String>) -> Self
pub fn with_snippet(self, snippet: impl Into<String>) -> Self
Set code snippet
Sourcepub fn with_exploitability(self, exploitability: Exploitability) -> Self
pub fn with_exploitability(self, exploitability: Exploitability) -> Self
Set exploitability metrics and compute score
Sourcepub fn with_code_context(self, context: CodeContext) -> Self
pub fn with_code_context(self, context: CodeContext) -> Self
Set code context (production, test, example, benchmark)
Sourcepub fn with_filter_reason(self, reason: impl Into<String>) -> Self
pub fn with_filter_reason(self, reason: impl Into<String>) -> Self
Mark this finding as filtered with a reason
Sourcepub fn is_non_production(&self) -> bool
pub fn is_non_production(&self) -> bool
Returns true if this finding is from non-production code
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
impl StructuralPartialEq for Finding
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more