Skip to main content

Module complexity

Module complexity 

Source
Expand description

Code complexity metrics calculation for all supported languages

Computes cyclomatic complexity, cognitive complexity, Halstead metrics, and maintainability index for functions/methods.

Structs§

ComplexityCalculator
Calculates complexity metrics from AST nodes
ComplexityThresholds
Thresholds for complexity warnings

Enums§

ComplexitySeverity
Severity of a complexity issue

Functions§

calculate_complexity
Calculate complexity for a function given its source code
calculate_complexity_from_source
Calculate complexity for source code without needing a tree-sitter node
check_complexity
Check complexity metrics against thresholds