Linux / Drivers / Iio
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 6,018 units with 127,909 lines of code in units (64.0% of code).
    • 1 very complex units (188 lines of code)
    • 14 complex units (1,985 lines of code)
    • 382 medium complex units (25,062 lines of code)
    • 994 simple units (36,828 lines of code)
    • 4,627 very simple units (63,846 lines of code)
<1% | 1% | 19% | 28% | 49%
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% | 1% | 19% | 28% | 49%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
light<1% | <1% | 22% | 31% | 45%
adc0% | 2% | 21% | 27% | 48%
accel0% | 3% | 15% | 30% | 50%
imu0% | 4% | 22% | 34% | 39%
chemical0% | 4% | 20% | 24% | 51%
frequency0% | 9% | 18% | 37% | 35%
dac0% | 0% | 14% | 25% | 59%
ROOT0% | 0% | 26% | 17% | 55%
magnetometer0% | 0% | 25% | 27% | 47%
gyro0% | 0% | 21% | 27% | 50%
pressure0% | 0% | 12% | 34% | 53%
proximity0% | 0% | 14% | 28% | 57%
common0% | 0% | 15% | 27% | 57%
temperature0% | 0% | 11% | 36% | 52%
health0% | 0% | 23% | 20% | 56%
humidity0% | 0% | 14% | 34% | 50%
dummy0% | 0% | 40% | 17% | 42%
addac0% | 0% | 22% | 9% | 68%
multiplexer0% | 0% | 51% | 10% | 37%
cdc0% | 0% | 40% | 40% | 18%
potentiostat0% | 0% | 48% | 31% | 20%
orientation0% | 0% | 17% | 34% | 48%
afe0% | 0% | 26% | 30% | 42%
amplifiers0% | 0% | 18% | 57% | 23%
buffer0% | 0% | 7% | 5% | 86%
filter0% | 0% | 11% | 37% | 50%
trigger0% | 0% | 0% | 33% | 66%
position0% | 0% | 0% | 47% | 52%
potentiometer0% | 0% | 0% | 6% | 93%
resolver0% | 0% | 0% | 36% | 63%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
188 56 2
92 39 3
125 36 1
191 36 3
177 35 1
174 34 4
134 31 5
143 30 2
164 29 1
186 29 2
104 27 1
145 27 2
122 27 1
100 27 1
128 26 1
32 25 2
39 25 2
130 25 1
97 25 2
122 24 5
69 24 4
31 24 2
130 24 1
60 24 5
127 24 1
139 23 1
96 23 4
104 23 1
102 23 1
134 23 2
72 22 3
84 22 1
81 22 3
80 22 5
144 22 2
87 21 5
115 21 5
93 21 3
88 21 3
120 21 4
81 20 4
93 20 5
84 20 1
53 20 2
122 20 1
102 20 6
104 20 4
123 20 1
82 20 1
92 20 5