pub struct QualityGate { /* private fields */ }Expand description
Quality Gate classifier
Implementations§
Source§impl QualityGate
impl QualityGate
Sourcepub fn with_weights(threshold: f32, weights: [f32; 8], bias: f32) -> Self
pub fn with_weights(threshold: f32, weights: [f32; 8], bias: f32) -> Self
Create with custom weights
Sourcepub fn evaluate(&mut self, features: &CodeQualityFeatures) -> QualityVerdict
pub fn evaluate(&mut self, features: &CodeQualityFeatures) -> QualityVerdict
Evaluate code and return verdict
Sourcepub fn score(&self, features: &CodeQualityFeatures) -> f32
pub fn score(&self, features: &CodeQualityFeatures) -> f32
Get quality score (0.0 to 1.0)
Sourcepub fn stats(&self) -> &QualityGateStats
pub fn stats(&self) -> &QualityGateStats
Get current statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics
Sourcepub fn set_threshold(&mut self, threshold: f32)
pub fn set_threshold(&mut self, threshold: f32)
Set threshold
Sourcepub fn filter_batch<'a>(
&mut self,
codes: &'a [GeneratedCode],
) -> Vec<&'a GeneratedCode>
pub fn filter_batch<'a>( &mut self, codes: &'a [GeneratedCode], ) -> Vec<&'a GeneratedCode>
Batch evaluate and return passing codes
Trait Implementations§
Source§impl Debug for QualityGate
impl Debug for QualityGate
Auto Trait Implementations§
impl Freeze for QualityGate
impl RefUnwindSafe for QualityGate
impl Send for QualityGate
impl Sync for QualityGate
impl Unpin for QualityGate
impl UnsafeUnpin for QualityGate
impl UnwindSafe for QualityGate
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> 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