pub struct ComplexityAnalyzer;
Expand description
Complexity analyzer for code analysis
Implementations§
Source§impl ComplexityAnalyzer
impl ComplexityAnalyzer
pub fn new() -> Self
Sourcepub fn analyze_file_complexity(
&self,
file_path: &Path,
metrics: &[String],
threshold_warnings: bool,
) -> Result<Value>
pub fn analyze_file_complexity( &self, file_path: &Path, metrics: &[String], threshold_warnings: bool, ) -> Result<Value>
Analyze complexity for a given file
Sourcepub fn calculate_all_metrics(
&self,
content: &str,
lines_count: usize,
) -> ComplexityMetrics
pub fn calculate_all_metrics( &self, content: &str, lines_count: usize, ) -> ComplexityMetrics
Calculate all complexity metrics for content
Sourcepub fn calculate_cyclomatic_complexity(&self, content: &str) -> usize
pub fn calculate_cyclomatic_complexity(&self, content: &str) -> usize
Calculate cyclomatic complexity (simplified)
Sourcepub fn calculate_cognitive_complexity(&self, content: &str) -> usize
pub fn calculate_cognitive_complexity(&self, content: &str) -> usize
Calculate cognitive complexity (simplified)
Sourcepub fn calculate_halstead_metrics(&self, content: &str) -> (f64, f64, f64)
pub fn calculate_halstead_metrics(&self, content: &str) -> (f64, f64, f64)
Calculate Halstead complexity metrics (simplified)
Sourcepub fn calculate_maintainability_index(
&self,
content: &str,
lines_count: usize,
) -> f64
pub fn calculate_maintainability_index( &self, content: &str, lines_count: usize, ) -> f64
Calculate maintainability index (simplified)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ComplexityAnalyzer
impl RefUnwindSafe for ComplexityAnalyzer
impl Send for ComplexityAnalyzer
impl Sync for ComplexityAnalyzer
impl Unpin for ComplexityAnalyzer
impl UnwindSafe for ComplexityAnalyzer
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> 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