pub struct ComplexityModel { /* private fields */ }Expand description
Learned complexity threshold replacing the fixed 500-line limit.
Inputs (3): language_type_ordinal, avg_file_size_in_project, team_size_proxy Output (1): per-language complexity threshold (line count)
Fallback: 500 lines (matching ComplexityAnalyzer default).
Implementations§
Source§impl ComplexityModel
impl ComplexityModel
Sourcepub fn drain_events(&mut self) -> Vec<EmlEvent>
pub fn drain_events(&mut self) -> Vec<EmlEvent>
Drain accumulated EML lifecycle events for ExoChain forwarding.
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Whether the model has been trained.
Sourcepub fn training_sample_count(&self) -> usize
pub fn training_sample_count(&self) -> usize
Number of training samples collected.
Sourcepub fn predict(
&self,
language_type: u32,
avg_file_size: f64,
team_size_proxy: f64,
) -> usize
pub fn predict( &self, language_type: u32, avg_file_size: f64, team_size_proxy: f64, ) -> usize
Predict the complexity threshold (line count) for a given context.
Result is clamped to [100, 5000] lines.
When untrained, returns 500 lines.
Sourcepub fn record(
&mut self,
language_type: u32,
avg_file_size: f64,
team_size_proxy: f64,
optimal_threshold: usize,
)
pub fn record( &mut self, language_type: u32, avg_file_size: f64, team_size_proxy: f64, optimal_threshold: usize, )
Record a complexity threshold observation for training.
optimal_threshold: the line count threshold that best separates
“too complex” from “acceptable” for this language and project context.
Trait Implementations§
Source§impl Clone for ComplexityModel
impl Clone for ComplexityModel
Source§impl Debug for ComplexityModel
impl Debug for ComplexityModel
Source§impl Default for ComplexityModel
impl Default for ComplexityModel
Source§impl<'de> Deserialize<'de> for ComplexityModel
impl<'de> Deserialize<'de> for ComplexityModel
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
Auto Trait Implementations§
impl Freeze for ComplexityModel
impl RefUnwindSafe for ComplexityModel
impl Send for ComplexityModel
impl Sync for ComplexityModel
impl Unpin for ComplexityModel
impl UnsafeUnpin for ComplexityModel
impl UnwindSafe for ComplexityModel
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,
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> ⓘ
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