Unit Size Overall
  • There are 5,496 units with 45,222 lines of code in units (74.6% of code).
    • 14 very long units (1,763 lines of code)
    • 54 long units (3,688 lines of code)
    • 379 medium size units (11,270 lines of code)
    • 680 small units (9,853 lines of code)
    • 4,369 very small units (18,648 lines of code)
3% | 8% | 24% | 21% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java3% | 8% | 24% | 21% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
hollow3% | 7% | 26% | 21% | 42%
hollow-protoadapter34% | 9% | 19% | 19% | 17%
hollow-diff-ui3% | 13% | 13% | 25% | 42%
hollow-jsonadapter0% | 19% | 21% | 30% | 28%
hollow-explorer-ui0% | 16% | 15% | 22% | 44%
hollow-perf0% | 9% | 28% | 20% | 41%
hollow-zenoadapter0% | 9% | 18% | 29% | 41%
hollow-fakedata0% | 0% | 49% | 12% | 37%
hollow-ui-tools0% | 0% | 17% | 25% | 57%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
183 48 2
164 22 0
162 42 2
142 50 3
129 39 2
123 43 3
114 11 5
113 28 0
108 2 0
108 1 0
106 26 4
105 17 0
104 33 0
102 36 3
100 41 5
99 1 0
97 26 6
96 12 0
94 16 3
90 33 6
89 16 3
87 47 2
87 8 3
85 14 3
81 23 5
80 27 5
79 24 1
79 25 4
78 14 0
74 19 5
74 24 1
71 9 3
70 14 5
69 30 2
69 23 4
69 20 0
68 13 5
66 19 3
66 34 3
66 13 0
65 19 2
63 16 2
63 5 20
62 11 0
61 18 1
61 7 2
60 13 1
60 18 8
60 11 7
59 14 1
About This Analysis
  • 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...
  • To learn more about unit size, the Sokrates recommends the following resources:
    • Function Length, MartinFowler.com
      • "If you have to spend effort into looking at a fragment of code to figure out what it's doing, then you should extract it into a function and name the function after that 'what'."
    • Stack Overflow Discussion on Unit Size, stackoverflow.com
      • "Use common sense, stick to small function sizes in most instances but don't be dogmatic about it if you have a genuinely good reason to make an unusually big function."
    • Coding Smells, codinghorror.com
      • "All other things being equal, a shorter method is easier to read, easier to understand, and easier to troubleshoot. Refactor long methods into smaller methods if you can."
    • Clean Code: A Handbook of Agile Software Craftsmanship, by Robert Martin
      • "The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that. Functions should not be 100 lines long. Functions should hardly ever be 20 lines long."