facebookincubator / katran
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 1,098 units with 14,147 lines of code in units (53.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 35 medium complex units (2,148 lines of code)
    • 118 simple units (3,400 lines of code)
    • 945 very simple units (8,599 lines of code)
0% | 0% | 15% | 24% | 60%
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
cpp0% | 0% | 15% | 23% | 60%
py0% | 0% | 13% | 26% | 59%
h0% | 0% | 36% | 0% | 63%
c0% | 0% | 30% | 26% | 42%
go0% | 0% | 6% | 21% | 72%
lua0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
katran/lib0% | 0% | 18% | 27% | 54%
build/fbcode_builder0% | 0% | 13% | 26% | 59%
tools/xdpdump0% | 0% | 42% | 4% | 52%
example/client0% | 0% | 16% | 3% | 79%
example_grpc/goclient0% | 0% | 11% | 18% | 70%
tools/start_katran0% | 0% | 0% | 25% | 74%
tools/tcpdump_encap_helper0% | 0% | 0% | 50% | 49%
katran/decap0% | 0% | 0% | 53% | 46%
example_grpc0% | 0% | 0% | 0% | 100%
example0% | 0% | 0% | 0% | 100%
tools/wireshark0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
76 25 4
109 24 5
83 24 2
56 23 0
92 23 2
62 22 1
81 22 0
113 22 4
40 19 2
73 19 2
37 17 5
41 17 1
55 16 4
44 16 3
75 15 2
41 15 2
43 15 3
85 15 1
65 14 2
76 14 2
77 14 2
128 13 3
43 12 0
31 12 3
50 12 4
9 12 2
52 12 1
88 12 3
47 12 2
31 11 4
31 11 2
46 11 0
51 11 0
74 11 3
43 11 2
24 10 3
23 10 4
29 10 3
43 10 2
26 10 6
25 10 3
15 10 3
73 10 3
56 10 1
47 10 0
39 10 2
29 9 2
27 9 2
41 9 1
34 9 3