Linux / Drivers / I2c
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,455 units with 49,749 lines of code in units (71.8% of code).
    • 1 very complex units (189 lines of code)
    • 25 complex units (3,016 lines of code)
    • 215 medium complex units (14,578 lines of code)
    • 315 simple units (11,515 lines of code)
    • 1,899 very simple units (20,451 lines of code)
<1% | 6% | 29% | 23% | 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
c<1% | 6% | 29% | 23% | 40%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
busses<1% | 5% | 29% | 23% | 41%
ROOT0% | 16% | 17% | 20% | 45%
algos0% | 13% | 38% | 17% | 30%
muxes0% | 0% | 37% | 23% | 38%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
189 60 7
174 42 7
86 36 2
161 33 2
147 33 3
189 32 4
68 32 5
69 31 4
52 31 2
106 31 1
149 30 3
195 30 1
165 29 1
91 29 7
112 29 1
111 28 7
108 28 3
147 28 7
89 27 3
139 27 7
141 27 4
92 27 2
131 27 1
83 27 1
89 26 1
122 26 4
104 25 2
113 25 7
98 25 1
97 25 2
105 25 7
87 25 7
74 25 3
124 24 1
100 24 2
94 24 2
177 24 7
107 24 3
112 24 3
73 23 4
111 23 1
87 23 7
83 23 7
39 22 3
92 22 2
81 22 1
82 22 7
76 22 4
100 22 1
81 22 1