Linux / Drivers / Nfc
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 657 units with 14,135 lines of code in units (74.7% of code).
    • 7 very long units (830 lines of code)
    • 34 long units (2,144 lines of code)
    • 210 medium size units (6,911 lines of code)
    • 179 small units (2,704 lines of code)
    • 227 very small units (1,546 lines of code)
5% | 15% | 48% | 19% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c5% | 15% | 48% | 19% | 10%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT13% | 11% | 43% | 19% | 12%
pn54418% | 16% | 43% | 16% | 4%
st21nfca6% | 12% | 51% | 20% | 8%
pn5334% | 16% | 45% | 22% | 10%
st95hf0% | 47% | 38% | 7% | 6%
microread0% | 39% | 41% | 8% | 10%
st-nci0% | 8% | 57% | 20% | 13%
s3fwrn50% | 12% | 53% | 20% | 13%
nfcmrvl0% | 7% | 48% | 27% | 17%
nxp-nci0% | 10% | 64% | 21% | 2%
fdp0% | 0% | 70% | 11% | 17%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
138 36 2
130 22 1
128 27 3
116 13 1
108 20 2
106 17 2
104 21 1
100 14 1
93 20 3
90 22 3
84 18 2
82 16 3
80 14 5
70 10 3
64 10 2
63 9 2
62 22 2
62 5 8
62 12 5
61 13 2
61 11 5
61 9 2
61 13 4
60 17 3
60 11 2
58 12 1
58 8 1
57 13 1
56 12 1
56 16 3
56 9 5
56 9 5
55 16 2
54 9 2
53 7 1
53 10 5
52 9 5
51 5 1
51 11 3
51 4 7
51 12 5
50 16 2
50 5 3
50 11 1
50 9 3
50 13 3
50 4 8
50 9 2
50 9 1
49 7 2