Unit Size Overall
  • There are 17,619 units with 186,187 lines of code in units (54.7% of code).
    • 77 very long units (19,163 lines of code)
    • 356 long units (24,838 lines of code)
    • 804 medium size units (22,241 lines of code)
    • 3,149 small units (46,581 lines of code)
    • 13,233 very small units (73,364 lines of code)
10% | 13% | 11% | 25% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs10% | 13% | 11% | 25% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src10% | 13% | 11% | 25% | 39%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
1883 260 4
1661 232 1
854 134 3
725 113 3
725 113 3
689 107 3
462 74 3
414 85 3
414 85 3
414 85 3
347 56 3
347 56 3
327 50 3
312 50 3
290 44 3
282 64 3
282 64 3
269 41 3
239 38 3
232 38 3
232 38 3
206 16 1
203 16 1
201 32 3
187 45 44
183 29 3
179 2 1
176 26 3
174 29 3
170 26 3
161 31 5
159 38 37
159 2 1
159 38 37
159 2 1
157 23 3
157 23 3
151 36 35
151 2 1
138 20 3
138 20 3
138 20 3
138 20 3
134 20 3
133 20 3
133 20 3
133 20 3
133 20 3
133 16 1
132 20 3
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."