facebook / rocksdb
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 15,005 units with 176,450 lines of code in units (66.6% of code).
    • 36 very complex units (10,879 lines of code)
    • 92 complex units (12,483 lines of code)
    • 417 medium complex units (28,586 lines of code)
    • 857 simple units (29,004 lines of code)
    • 13,603 very simple units (95,498 lines of code)
6% | 7% | 16% | 16% | 54%
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
cc7% | 8% | 19% | 18% | 46%
h3% | 1% | 5% | 11% | 77%
py0% | 4% | 17% | 23% | 54%
java0% | <1% | 3% | 5% | 90%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
db10% | 13% | 18% | 16% | 40%
tools11% | 11% | 24% | 21% | 31%
db_stress_tool23% | 9% | 27% | 11% | 26%
java2% | <1% | 5% | 9% | 81%
util6% | 4% | 6% | 17% | 64%
utilities2% | 4% | 16% | 19% | 58%
table2% | 7% | 23% | 21% | 45%
file0% | 10% | 26% | 27% | 35%
trace_replay0% | 13% | 20% | 26% | 39%
memtable0% | 7% | 14% | 10% | 66%
buckifier0% | 37% | 0% | 8% | 54%
options0% | 0% | 42% | 17% | 39%
env0% | 0% | 9% | 14% | 76%
microbench0% | 0% | 50% | 24% | 25%
port0% | 0% | 5% | 26% | 68%
logging0% | 0% | 20% | 18% | 60%
monitoring0% | 0% | 2% | 15% | 82%
include0% | 0% | <1% | 3% | 95%
memory0% | 0% | 0% | 24% | 75%
build_tools0% | 0% | 0% | 27% | 72%
coverage0% | 0% | 0% | 49% | 50%
fuzz0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
356 175 1
358 175 1
517 163 3
443 125 0
442 109 5
307 104 0
291 92 1
382 89 3
322 83 9
342 77 2
310 77 5
282 76 2
330 76 1
504 74 0
368 74 5
374 71 4
281 69 1
145 69 2
254 67 5
320 66 4
392 65 1
408 62 1
237 62 5
214 61 3
227 61 2
289 60 3
252 59 7
300 58 28
232 57 5
250 55 6
262 55 1
219 55 2
110 52 1
110 52 1
229 51 4
220 51 3
201 50 0
180 50 2
210 49 4
131 48 3
182 47 5
177 46 4
120 46 4
154 45 3
222 45 3
191 44 8
143 43 14
110 42 9
100 42 7
174 41 3