Linux / Drivers / Block
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,569 units with 54,270 lines of code in units (76.4% of code).
    • 7 very complex units (1,262 lines of code)
    • 29 complex units (3,644 lines of code)
    • 207 medium complex units (12,778 lines of code)
    • 396 simple units (13,577 lines of code)
    • 1,930 very simple units (23,009 lines of code)
2% | 6% | 23% | 25% | 42%
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
c2% | 6% | 23% | 25% | 42%
h0% | 6% | 3% | 22% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
drbd5% | 11% | 25% | 19% | 38%
ROOT1% | 5% | 21% | 27% | 43%
mtip32xx0% | 7% | 40% | 20% | 31%
xen-blkback0% | 8% | 36% | 28% | 26%
rnbd0% | 6% | 5% | 19% | 68%
zram0% | 7% | 12% | 18% | 60%
paride0% | 0% | 24% | 33% | 41%
null_blk0% | 0% | 23% | 28% | 48%
aoe0% | 0% | 23% | 27% | 48%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
191 113 5
144 76 4
184 66 1
306 66 2
161 55 4
156 55 3
120 52 2
189 50 3
141 49 3
97 44 3
138 40 4
160 37 3
133 37 1
114 37 4
177 37 2
51 37 1
155 36 2
199 35 4
158 34 1
74 34 4
129 32 2
146 31 2
140 30 3
60 30 1
124 29 4
158 29 1
117 29 2
173 29 1
73 29 1
135 29 2
46 28 4
83 28 2
112 28 2
126 27 2
106 26 3
130 26 2
108 25 4
127 25 2
132 25 2
62 25 2
109 24 2
107 24 1
148 24 1
77 24 1
100 23 1
75 23 11
105 23 1
67 22 2
79 22 1
108 22 4