Linux / Drivers / Mtd
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 3,959 units with 91,658 lines of code in units (76.0% of code).
    • 3 very complex units (708 lines of code)
    • 45 complex units (6,050 lines of code)
    • 366 medium complex units (25,218 lines of code)
    • 645 simple units (23,222 lines of code)
    • 2,900 very simple units (36,460 lines of code)
<1% | 6% | 27% | 25% | 39%
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
c<1% | 6% | 27% | 25% | 39%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
nand<1% | 5% | 26% | 25% | 42%
ROOT3% | 8% | 29% | 25% | 31%
ubi0% | 15% | 36% | 20% | 27%
maps0% | 9% | 22% | 25% | 41%
parsers0% | 20% | 35% | 23% | 20%
devices0% | 4% | 15% | 30% | 49%
chips0% | 3% | 35% | 29% | 32%
spi-nor0% | 2% | 23% | 22% | 51%
lpddr0% | 0% | 20% | 44% | 34%
hyperbus0% | 0% | 34% | 12% | 53%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
324 97 3
211 56 1
173 52 3
170 47 4
208 45 2
184 41 3
163 41 1
196 41 3
200 41 3
116 39 4
171 38 1
129 37 2
86 37 2
146 36 3
127 35 3
84 34 4
162 34 1
137 34 2
167 34 3
163 33 2
148 33 2
165 33 3
94 32 2
144 32 1
131 31 2
93 31 3
89 30 1
158 30 2
92 30 3
114 29 1
158 29 1
109 29 2
130 29 3
197 28 1
163 28 4
78 28 4
147 28 4
114 28 2
81 28 4
98 27 2
118 27 3
52 27 1
212 27 1
107 27 1
87 26 4
129 26 1
161 26 1
72 26 3
82 25 1
134 25 1