facebookincubator / hsthrift
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 670 units with 6,205 lines of code in units (19.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (80 lines of code)
    • 16 medium complex units (741 lines of code)
    • 63 simple units (1,504 lines of code)
    • 590 very simple units (3,880 lines of code)
0% | 1% | 11% | 24% | 62%
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
py0% | 1% | 12% | 26% | 59%
cpp0% | 0% | 23% | 25% | 50%
c0% | 0% | 0% | 33% | 66%
h0% | 0% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
build/fbcode_builder0% | 1% | 11% | 26% | 60%
server/cpp0% | 0% | 67% | 0% | 32%
common/util0% | 0% | 5% | 14% | 79%
cpp-channel/cpp0% | 0% | 0% | 23% | 76%
serialization0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
80 29 4
64 23 4
40 19 2
72 19 2
37 17 5
41 17 1
103 16 6
44 16 3
35 14 3
77 13 3
39 12 0
31 12 3
50 12 4
9 12 2
39 11 4
31 11 4
29 11 2
29 10 3
43 10 2
26 10 6
25 10 3
15 10 3
69 9 5
24 9 1
29 9 2
27 9 2
41 9 1
33 9 3
21 9 4
32 8 3
27 8 3
20 8 1
46 8 2
17 8 2
25 8 1
16 8 2
23 8 3
27 8 3
14 8 5
17 8 3
21 8 1
17 8 2
14 7 2
78 7 0
14 7 2
16 7 3
14 7 4
11 7 2
14 7 3
27 7 0