anthropics / cargo-nix-plugin
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 210 units with 4,462 lines of code in units (53.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (108 lines of code)
    • 2 medium complex units (131 lines of code)
    • 20 simple units (803 lines of code)
    • 187 very simple units (3,420 lines of code)
0% | 2% | 2% | 17% | 76%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
rs0% | 2% | 2% | 17% | 76%
cc0% | 0% | 0% | 41% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
builder0% | 12% | 0% | 39% | 48%
rust0% | 0% | 3% | 12% | 83%
cpp0% | 0% | 0% | 41% | 58%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
108 35 2
50 14 3
81 12 6
31 10 4
38 10 1
36 9 2
37 9 1
37 9 4
39 9 1
38 8 2
52 8 5
111 8 5
64 8 2
62 8 4
24 8 1
20 8 1
40 8 2
21 8 0
37 7 4
32 7 1
29 7 1
33 6 1
22 6 1
49 5 1
20 5 1
457 5 0
21 5 4
5 5 1
17 5 3
17 5 1
20 5 1
9 5 1
20 5 3
12 4 2
49 4 5
74 4 2
26 4 0
31 4 1
46 4 2
13 4 2
37 4 1
15 4 1
16 4 2
18 3 3
14 3 3
16 3 1
22 3 0
11 3 1
29 3 2
29 3 4