facebookincubator / Glean
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 996 units with 8,832 lines of code in units (13.1% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (539 lines of code)
    • 13 medium complex units (807 lines of code)
    • 42 simple units (1,322 lines of code)
    • 938 very simple units (6,164 lines of code)
0% | 6% | 9% | 14% | 69%
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% | 7% | 10% | 17% | 64%
h0% | 0% | 5% | 6% | 87%
rs0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
glean/lang0% | 18% | 8% | 16% | 56%
glean/rts0% | 2% | 12% | 12% | 72%
glean/rocksdb0% | 0% | 0% | 27% | 72%
glean/interprocess0% | 0% | 0% | 15% | 84%
glean/cpp0% | 0% | 0% | 0% | 100%
glean/config0% | 0% | 0% | 0% | 100%
glean/tools0% | 0% | 0% | 0% | 100%
glean/website0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
301 41 1
108 34 3
130 26 2
109 22 3
162 18 13
47 18 2
68 17 2
53 17 1
67 14 4
36 13 2
46 13 4
53 12 5
59 12 3
46 12 2
27 11 1
34 11 1
61 10 6
31 10 1
73 9 4
53 9 2
35 9 1
27 9 1
52 9 2
29 9 2
21 9 1
18 9 1
23 9 3
23 8 2
4 8 1
18 8 1
20 8 1
31 8 2
46 8 4
22 8 1
65 7 1
49 7 1
44 7 3
41 7 5
30 7 1
24 7 1
26 7 1
23 7 1
17 6 0
26 6 0
11 6 4
11 6 4
35 6 1
76 6 1
17 6 3
24 6 3