Skip to main content

Module complexity

Module complexity 

Source
Expand description

Extract cyclomatic complexity per function, with source spans.

We use syn for two reasons beyond just getting a CC number: it gives us the typed Rust AST with precise line spans for every function, and it handles free functions, impl methods, and nested scopes uniformly via its Visit trait. LCOV’s FN:line,name record only gives us the starting line — the span has to come from the AST.

Structs§

FunctionComplexity
One function’s complexity, with enough location info to join against a coverage report later.

Functions§

analyze_file
Analyze a single Rust source file and return every function found.
analyze_tree
Walk a directory tree and analyze every .rs file, honoring .gitignore.