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: f64Inline 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
impl Clone for HotspotRow
§fn clone(&self) -> HotspotRow
fn clone(&self) -> HotspotRow
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HotspotRow
impl Debug for HotspotRow
§impl<'de> Deserialize<'de> for HotspotRow
impl<'de> Deserialize<'de> for HotspotRow
§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>,
§impl Serialize for HotspotRow
impl Serialize for HotspotRow
Auto Trait Implementations§
impl Freeze for HotspotRow
impl RefUnwindSafe for HotspotRow
impl Send for HotspotRow
impl Sync for HotspotRow
impl Unpin for HotspotRow
impl UnsafeUnpin for HotspotRow
impl UnwindSafe for HotspotRow
Blanket Implementations§
impl<T> Allocation for T
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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