Unit Size Overall
  • There are 9,666 units with 98,584 lines of code in units (78.1% of code).
    • 50 very long units (7,610 lines of code)
    • 203 long units (13,723 lines of code)
    • 785 medium size units (23,975 lines of code)
    • 1,346 small units (19,404 lines of code)
    • 7,282 very small units (33,872 lines of code)
7% | 13% | 24% | 19% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java7% | 13% | 24% | 19% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src7% | 13% | 24% | 19% | 34%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
530 92 9
270 5 0
257 65 7
202 1 0
199 28 11
197 62 0
192 41 5
190 52 9
181 29 5
180 32 4
178 64 0
175 83 1
173 30 6
172 50 3
164 48 4
157 19 3
154 17 9
153 44 3
151 50 0
144 40 3
142 28 2
142 23 3
135 33 1
130 25 4
130 34 4
130 22 3
129 17 10
126 20 3
124 17 2
124 42 0
123 42 0
123 33 1
121 50 0
120 31 3
120 22 2
119 14 11
118 1 0
117 16 5
115 31 2
115 11 5
115 30 2
114 29 1
113 42 4
110 26 3
109 28 0
107 37 0
107 28 1
106 26 1
106 26 2
101 34 0
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."