Linux / Drivers / Char
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,520 units with 51,581 lines of code in units (74.0% of code).
    • 5 very complex units (1,154 lines of code)
    • 26 complex units (3,590 lines of code)
    • 163 medium complex units (10,294 lines of code)
    • 387 simple units (13,700 lines of code)
    • 1,939 very simple units (22,843 lines of code)
2% | 6% | 19% | 26% | 44%
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% | 20% | 26% | 44%
h0% | 0% | 0% | 10% | 89%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mwave14% | 14% | 12% | 21% | 36%
pcmcia5% | 18% | 22% | 19% | 34%
ROOT2% | 3% | 24% | 24% | 45%
ipmi1% | 10% | 15% | 31% | 40%
xillybus6% | 22% | 29% | 23% | 18%
tpm0% | 3% | 20% | 27% | 47%
agp0% | 1% | 21% | 25% | 51%
hw_random0% | 0% | 12% | 28% | 58%
xilinx_hwicap0% | 0% | 14% | 27% | 57%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
247 72 3
251 64 4
263 60 1
209 57 4
184 52 4
257 48 3
224 43 2
139 43 2
192 40 3
195 40 2
211 39 1
120 38 1
127 37 2
136 36 3
88 36 2
152 36 4
108 35 3
143 35 5
99 34 2
71 33 3
123 33 2
138 33 2
99 32 6
67 31 3
100 31 4
89 30 2
88 29 3
106 29 4
141 29 2
121 26 3
256 26 3
124 25 1
82 25 4
89 25 1
84 25 4
109 24 1
88 23 4
89 23 1
75 23 2
146 22 2
71 22 4
96 22 1
141 22 1
97 21 2
113 21 1
68 21 3
95 21 2
45 20 2
66 20 2
66 19 3