Linux / Drivers / Hwmon
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,865 units with 76,311 lines of code in units (60.3% of code).
    • 8 very complex units (2,071 lines of code)
    • 45 complex units (4,538 lines of code)
    • 262 medium complex units (14,578 lines of code)
    • 487 simple units (15,949 lines of code)
    • 3,063 very simple units (39,175 lines of code)
2% | 5% | 19% | 20% | 51%
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% | 5% | 19% | 20% | 51%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT2% | 5% | 17% | 20% | 54%
pmbus5% | 7% | 32% | 25% | 28%
occ0% | 26% | 20% | 27% | 24%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
311 106 3
717 98 1
168 94 2
53 78 2
219 65 1
287 64 1
142 57 1
174 53 4
138 48 1
170 46 1
77 43 4
78 42 1
125 40 1
177 39 1
88 38 2
80 37 2
149 37 1
81 37 3
74 36 2
108 36 4
109 36 4
106 34 1
114 34 1
87 33 4
72 33 2
105 31 1
63 31 4
114 31 1
140 30 1
129 30 1
139 29 1
99 29 1
94 29 5
253 29 1
43 28 3
93 28 1
78 28 4
58 27 2
58 27 2
58 27 2
85 27 2
61 27 4
112 27 1
81 26 2
106 26 1
92 26 2
67 26 3
152 26 4
90 26 1
92 26 2