1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Function-level complexity metrics.
//!
//! This module provides heuristic-based function detection and metrics
//! for common programming languages. It uses regex patterns to identify
//! function definitions and estimates function boundaries using
//! indentation and brace-matching heuristics.
//!
//! ## Supported Languages
//!
//! - Rust: `fn name`
//! - Python: `def name`
//! - JavaScript/TypeScript: `function name`, arrow functions, method syntax
//! - Go: `func name`
//!
//! ## Cyclomatic Complexity
//!
//! This module also provides heuristic-based cyclomatic complexity estimation.
//! It counts decision points per function without full AST parsing:
//!
//! - `if`, `else if`, `elif` -> +1
//! - `match`, `switch`, `case` -> +1 per arm
//! - `for`, `while`, `loop` -> +1
//! - `&&`, `||` (logical operators) -> +1
//! - `?` (ternary/try) -> +1
//! - `catch`, `except` -> +1
//!
//! Base complexity is 1 per function, plus decision points.
//!
//! ## Limitations
//!
//! This is a heuristic approach and may not handle all edge cases:
//! - Nested functions may be double-counted
//! - Multi-line signatures may not be detected correctly
//! - Closures and lambdas have limited support
//! - Keywords in strings/comments may be counted (fast but imperfect)
pub use ;
pub use ;
pub use ;
// Preserve the historical `content::complexity::NestingAnalysis` path even
// though current callers only use `analyze_nesting_depth` directly.
pub use ;