Expand description
Code complexity analysis module.
This module provides complexity analysis across multiple languages:
- Cyclomatic Complexity: Measures control flow complexity
- Cognitive Complexity: Measures understandability
- Lines of Code (LOC/SLOC): Source line counts
- Function Length: Average and maximum function lengths
- Nesting Depth: Maximum nesting level
§Example
use linthis::complexity::{ComplexityAnalyzer, AnalysisOptions};
use std::path::PathBuf;
let analyzer = ComplexityAnalyzer::new();
let options = AnalysisOptions::new(PathBuf::from("."));
let result = analyzer.analyze(&options).expect("Analysis failed");
for file in result.files {
println!("{}: cyclomatic={}", file.path.display(), file.metrics.cyclomatic);
}Re-exports§
pub use report::format_complexity_report;pub use report::ComplexityReportFormat;
Modules§
- report
- Complexity report formatting module.
Structs§
- Analysis
Options - Options for complexity analysis
- Analysis
Result - Result of complexity analysis
- Complexity
Analyzer - Main complexity analyzer
- Complexity
Metrics - Complexity metrics for a single entity (file or function)
- File
Metrics - Metrics for a single file
- Function
Metrics - Metrics for a single function/method
- Threshold
Config - Threshold levels for different metrics
- Thresholds
- Collection of all thresholds
Enums§
- Metric
Level - Metric severity level