facebook / CacheLib
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 2,556 units with 22,416 lines of code in units (49.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (152 lines of code)
    • 31 medium complex units (1,802 lines of code)
    • 119 simple units (4,186 lines of code)
    • 2,405 very simple units (16,276 lines of code)
0% | <1% | 8% | 18% | 72%
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
h0% | 1% | 8% | 14% | 75%
cpp0% | 0% | 8% | 22% | 69%
rs0% | 0% | 0% | 15% | 84%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cachelib/cachebench0% | 6% | 8% | 13% | 71%
cachelib/allocator0% | 0% | 9% | 20% | 70%
cachelib/benchmarks0% | 0% | 7% | 26% | 65%
cachelib/navy0% | 0% | 3% | 20% | 75%
cachelib/common0% | 0% | 7% | 13% | 79%
cachelib/compact_cache0% | 0% | 13% | 24% | 62%
cachelib/persistence0% | 0% | 34% | 0% | 65%
cachelib/shm0% | 0% | 12% | 22% | 64%
cachelib/datatype0% | 0% | 6% | 10% | 82%
cachelib/rust0% | 0% | 0% | 12% | 88%
cachelib/experimental0% | 0% | 0% | 0% | 100%
website0% | 0% | 0% | 0% | 100%
website/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
152 33 1
47 18 2
41 17 3
85 17 3
78 17 3
82 16 0
62 15 2
56 15 2
57 15 3
52 14 3
59 14 2
61 14 1
86 14 1
63 14 2
102 14 1
53 13 9
40 13 2
83 13 0
46 13 0
56 13 3
31 12 3
44 12 1
89 12 1
39 12 2
34 12 2
58 12 4
67 11 4
49 11 0
31 11 0
63 11 1
56 11 5
32 11 1
30 10 2
61 10 3
25 10 1
58 10 4
53 10 2
46 10 1
32 10 1
48 10 2
41 10 2
39 9 1
90 9 3
29 9 1
44 9 3
67 9 2
42 9 2
31 9 0
21 9 1
27 9 0