Skip to main content

ScanReport

Struct ScanReport 

Source
pub struct ScanReport {
    pub merges_seen: usize,
    pub merges_scanned: usize,
    pub skipped_octopus: usize,
    pub skipped_no_base: usize,
    pub paths_scanned: usize,
    pub skipped_binary: usize,
    pub skipped_large: usize,
    pub lines_relocated: usize,
    pub paths_all_relocated: usize,
    pub lines_surviving_elsewhere: usize,
    pub findings_all_surviving: usize,
    pub findings: Vec<Finding>,
}
Expand description

What one repository’s scan counted.

Every skip is counted rather than dropped: a rate whose denominator quietly excluded the hard cases is the failure mode this whole measurement exists to avoid.

Fields§

§merges_seen: usize

Merge commits the log produced.

§merges_scanned: usize

Merge commits actually compared.

§skipped_octopus: usize

Merges with three or more parents, which this comparison does not model: there is no single proposed side.

§skipped_no_base: usize

Merges whose parents share no merge base, or whose objects are missing from a filtered clone.

§paths_scanned: usize

Paths compared.

§skipped_binary: usize

Paths where some blob was not valid UTF-8.

§skipped_large: usize

Paths where some blob exceeded MAX_BLOB_BYTES.

§lines_relocated: usize

Distinct lines cancelled as moved between paths within one merge rather than lost. See scan_merge.

§paths_all_relocated: usize

Paths whose whole apparent violation was relocation, and which therefore produced no finding.

§lines_surviving_elsewhere: usize

Distinct lines reported as reverted that are nonetheless present somewhere in the merge result. Counted, never cancelled: see scan_merge on why this is a second number and not a filter.

§findings_all_surviving: usize

Findings every one of whose reverted lines survives somewhere in the result, and which carry no injection either. These are the candidates for refactor noise rather than lost work.

§findings: Vec<Finding>

The violations, in the order found.

Implementations§

Source§

impl ScanReport

Source

pub fn merge_violation_rate(&self) -> f64

Merges carrying at least one finding, over merges scanned.

Returns 0.0 for an empty scan rather than a NaN: “nothing was examined” and “nothing was found” must not print the same way.

Source

pub fn absorb(&mut self, other: Self)

Folds another repository’s report into this one.

Trait Implementations§

Source§

impl Clone for ScanReport

Source§

fn clone(&self) -> ScanReport

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScanReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScanReport

Source§

fn default() -> ScanReport

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ScanReport

Source§

fn eq(&self, other: &ScanReport) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ScanReport

Source§

impl StructuralPartialEq for ScanReport

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.