pub struct Finding {Show 13 fields
pub category: Category,
pub path: String,
pub name: String,
pub exported_as: Option<String>,
pub symbol_kind: Option<SymbolKind>,
pub parent: Option<String>,
pub language: String,
pub start: Location,
pub end: Location,
pub lines: u32,
pub confidence: u8,
pub reasons: Vec<Reason>,
pub message: String,
}Expand description
A single piece of dead code.
Fields§
§category: CategoryWhich rule produced this.
path: StringScan-root-relative path of the file the finding is in.
name: StringDeclared name. Empty for Category::UnusedFile.
exported_as: Option<String>The name other modules would import it by, when it differs from name.
symbol_kind: Option<SymbolKind>What kind of declaration this is. None for a whole-file finding.
parent: Option<String>Enclosing class or enum name, for members.
language: StringThe analyzer’s language id (js, python, …). A string rather than
an enum so that a new language is a new analyzer, not a new variant in
this crate.
start: Location§end: Location§lines: u32Lines the declaration spans — the size of the deletion.
confidence: u80-100. See basta::confidence for how it is derived.
reasons: Vec<Reason>Why the confidence is not 100, most significant first.
message: StringOne-line human-readable statement of the finding.
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn level(&self) -> ConfidenceLevel
pub fn level(&self) -> ConfidenceLevel
Confidence as a coarse bucket, for reporters that cannot show a number.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Stable identity of a finding across runs: the same declaration in the same file keeps its fingerprint when unrelated lines move, because the line number is deliberately not part of it.
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>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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