Skip to main content

HotspotRow

Struct HotspotRow 

pub struct HotspotRow {
    pub path: String,
    pub revisions: u32,
    pub cognitive: f64,
    pub cognitive_health: f64,
    pub hotspot_score: f64,
    pub mi: Option<f64>,
    pub mi_rank: Option<f64>,
    pub ai_pct: Option<f64>,
    pub hotspot_score_anchored: Option<f64>,
}

Fields§

§path: String§revisions: u32§cognitive: f64§cognitive_health: f64

Inline structural proxy on [60, 100] (higher = healthier), computed from cognitive complexity alone as 100 × (1 − 0.40 × normalize(cognitive)). This is the hotspots analysis’s own signal for ranking — NOT the code-health analysis’s 8-smell composite score. A file can read healthy here and unhealthy in code-health; the two are distinct.

§hotspot_score: f64§mi: Option<f64>

File-level Maintainability Index (SEI variant). None when the file has no kind='unit' complexity entry — typically because the language isn’t supported by codelore-rca or the file was skipped for size / clone reasons at ingest.

§mi_rank: Option<f64>

Percentile rank of this file’s MI within the analyzed repo, in [0, 1]. None when mi is unknown. Used by the crate::analyses::mi::MiBand classifier to derive a repo-relative Low / Moderate / High label — see that module’s docs for why the bands are percentile-based rather than absolute Coleman/SEI thresholds.

§ai_pct: Option<f64>

Percentage of commits touching this file that carry an AI-attribution signal (ai-assisted or ai-authored per identity::bots). Range [0, 100]. None when no commits touched the file (shouldn’t happen in practice since hotspots filters to revs >= min_revs, but defensive against schema drift). Unlike MI, this is a true percentage so absolute interpretation is meaningful across repos.

§hotspot_score_anchored: Option<f64>

Corpus-anchored hotspot score. The hotspot_score formula with its two repo-relative cognitive terms — the complexity percentile rank and the inline cognitive_health proxy’s max-normalisation — both replaced by the file’s cognitive complexity percentile within the calibration corpus’s non-trivial tail for its language. The corpus pools are dominated by zero-complexity functions, so a raw percentile saturates every real file near the top; conditioning on the functions that carry any decision structure re-spreads the informative tail (see crate::calibration::conditional_tail_percentile). The revisions percentile stays repo-relative by design (churn is a within-repo concentration signal, not comparable across repos), so only the complexity coupling is anchored. So — holding the revision population fixed — improving a file in place (dropping its complexity without adding or removing a revision) leaves every other file’s anchored score bit-for-bit unchanged, because the cp_tail term cannot see another file. The revisions term does NOT share that property: pr_rev = PERCENT_RANK() OVER (ORDER BY revs) is repo-relative, so a change to the revision population itself — a new file clearing min_revs, or a refactor commit that reorders the churn ranks — still moves untouched files’ scores through it. The absolute ceiling (hotspot_anchored_max) carries margin above the measured worst to absorb that; anchoring pr_rev against the corpus too is a recorded design decision, deliberately not taken.

None — omitted from every surface, never rendered as 0.00 — when no calibration artifact is active, the file’s language is absent from the corpus / pooled below the sample floor, or that language’s corpus pool is entirely trivial (an empty tail). Populated by apply_hotspot_anchor; run_hotspots alone leaves it None, so the SPA payload and the internal hotspot consumers stay byte-identical.

Trait Implementations§

§

impl Clone for HotspotRow

§

fn clone(&self) -> HotspotRow

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
§

impl Debug for HotspotRow

§

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

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for HotspotRow

§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Serialize for HotspotRow

§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more