novifinancial / serde-reflection
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 929 units with 9,828 lines of code in units (67.2% of code).
    • 7 very long units (1,021 lines of code)
    • 15 long units (1,180 lines of code)
    • 89 medium size units (2,677 lines of code)
    • 117 small units (1,649 lines of code)
    • 701 very small units (3,301 lines of code)
10% | 12% | 27% | 16% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs14% | 15% | 34% | 15% | 19%
py0% | 30% | 0% | 17% | 52%
java0% | 0% | 18% | 26% | 55%
hpp0% | 0% | 15% | 12% | 71%
cs0% | 0% | 19% | 26% | 53%
go0% | 0% | 11% | 22% | 66%
dart0% | 0% | 7% | 19% | 73%
ts0% | 0% | 0% | 6% | 93%
swift0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
serde-generate/src20% | 19% | 37% | 12% | 10%
serde-generate/runtime/python0% | 30% | 0% | 17% | 52%
serde-reflection/src0% | 4% | 29% | 22% | 42%
serde-generate/runtime/java0% | 0% | 18% | 26% | 55%
serde-generate/runtime/cpp0% | 0% | 15% | 12% | 71%
serde-generate/runtime/csharp0% | 0% | 19% | 26% | 53%
serde-generate/runtime/golang0% | 0% | 11% | 22% | 66%
serde-generate/runtime/dart0% | 0% | 7% | 19% | 73%
serde-name/src0% | 0% | 0% | 29% | 70%
serde-generate/runtime/typescript0% | 0% | 0% | 6% | 93%
serde-generate/runtime/swift0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
257 45 5
187 18 5
156 21 5
110 10 3
104 6 3
104 6 3
103 7 3
100 6 3
97 10 5
90 12 5
88 5 0
85 7 3
84 5 3
83 4 3
79 10 3
79 9 5
78 6 3
73 20 2
72 6 2
61 6 3
56 7 3
55 21 3
50 9 4
50 3 3
49 7 2
48 3 3
45 7 1
45 2 2
45 3 3
44 4 4
44 7 3
44 2 5
42 6 4
42 2 2
42 3 2
41 1 2
41 3 2
40 7 2
40 2 1
39 1 2
38 2 5
37 3 3
36 10 2
36 1 2
35 9 1
34 1 2
34 2 3
33 2 2
33 1 2
32 1 5