Linux / Drivers / Base
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 1,693 units with 23,289 lines of code in units (74.1% of code).
    • 1 very complex units (244 lines of code)
    • 7 complex units (896 lines of code)
    • 61 medium complex units (2,861 lines of code)
    • 182 simple units (5,195 lines of code)
    • 1,442 very simple units (14,093 lines of code)
1% | 3% | 12% | 22% | 60%
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
c1% | 3% | 12% | 22% | 60%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
regmap4% | 8% | 18% | 19% | 50%
power0% | 3% | 14% | 26% | 55%
ROOT0% | 2% | 8% | 20% | 68%
firmware_loader0% | 0% | 4% | 25% | 70%
Most Complex Units
Top 50 most complex units
Unit# linesMcCabe index# params
244 67 7
127 39 1
139 38 2
125 37 2
151 34 5
122 32 1
123 30 2
109 28 2
83 25 1
87 23 3
68 23 2
52 20 3
62 19 2
66 19 3
46 19 2
49 18 3
37 18 2
48 18 3
25 18 2
56 18 4
51 18 2
52 17 3
83 17 1
62 17 1
48 17 1
44 16 3
62 16 3
57 16 1
75 16 3
52 15 3
55 15 4
69 15 1
13 14 1
57 14 1
60 14 3
49 14 2
32 13 2
41 13 2
73 13 3
61 13 5
42 13 1
17 13 2
22 12 2
23 12 1
36 12 1
38 12 2
46 12 1
57 12 4
35 12 4
50 12 4