facebook / zstd
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,159 units with 40,501 lines of code in units (59.3% of code).
    • 6 very complex units (1,715 lines of code)
    • 30 complex units (3,753 lines of code)
    • 187 medium complex units (11,707 lines of code)
    • 214 simple units (6,479 lines of code)
    • 1,722 very simple units (16,847 lines of code)
4% | 9% | 28% | 15% | 41%
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
c3% | 9% | 30% | 15% | 39%
cpp30% | 13% | 17% | 17% | 21%
py0% | 31% | 13% | 21% | 34%
h0% | 0% | 9% | 16% | 74%
lua0% | 0% | 100% | 0% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
programs15% | <1% | 26% | 14% | 42%
lib/compress4% | 14% | 22% | 12% | 46%
contrib/pzstd25% | 0% | 14% | 12% | 46%
lib/decompress7% | 9% | 20% | 17% | 45%
contrib/match_finders52% | 0% | 10% | 5% | 30%
lib/legacy0% | 7% | 44% | 15% | 32%
zlibWrapper0% | 20% | 25% | 23% | 30%
lib/dictBuilder0% | 17% | 26% | 25% | 30%
contrib/freestanding_lib0% | 38% | 14% | 17% | 29%
contrib/gen_html0% | 73% | 0% | 10% | 16%
lib/common0% | 0% | 18% | 11% | 70%
doc/educational_decoder0% | 0% | 12% | 31% | 56%
contrib/seekable_format0% | 0% | 14% | 24% | 60%
contrib/diagnose_corruption0% | 0% | 36% | 20% | 43%
contrib/premake0% | 0% | 100% | 0% | 0%
contrib/largeNbDicts0% | 0% | 11% | 33% | 55%
build/single_file_libs0% | 0% | 16% | 55% | 27%
contrib/recovery0% | 0% | 0% | 55% | 44%
contrib/linux-kernel0% | 0% | 0% | 0% | 100%
lib/deprecated0% | 0% | 0% | 0% | 100%
build/meson0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
608 224 2
267 85 2
203 61 10
196 59 7
256 56 3
185 51 3
168 48 4
146 46 7
171 40 2
122 39 2
23 39 2
170 39 6
127 38 1
53 38 3
155 37 3
159 36 1
122 35 6
43 35 1
127 35 3
135 33 6
110 33 9
119 31 3
115 31 3
116 31 3
120 31 5
140 31 5
181 30 6
134 30 5
88 29 5
118 29 5
98 28 2
159 28 9
149 27 7
142 27 5
98 26 1
145 26 6
145 25 7
75 24 4
43 24 6
45 24 6
45 24 6
94 24 5
45 24 6
45 24 6
70 23 5
66 23 13
127 23 5
89 23 6
59 22 3
108 22 10