Unit Size Overall
  • There are 3,131 units with 41,652 lines of code in units (84.3% of code).
    • 61 very long units (9,840 lines of code)
    • 78 long units (5,401 lines of code)
    • 306 medium size units (9,620 lines of code)
    • 251 small units (3,702 lines of code)
    • 2,435 very small units (13,089 lines of code)
23% | 12% | 23% | 8% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go23% | 12% | 23% | 8% | 31%
ts44% | 17% | 17% | 8% | 12%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
internal23% | 12% | 22% | 8% | 31%
evals43% | 17% | 17% | 8% | 12%
cmd0% | 0% | 73% | 15% | 11%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
256 58 1
249 58 1
249 58 1
249 58 1
245 56 1
245 56 1
245 56 1
242 55 1
237 56 1
214 65 3
205 49 1
202 48 1
202 48 1
199 47 1
199 47 1
198 46 1
198 46 1
198 46 1
197 46 1
196 46 1
196 46 1
196 44 1
174 39 1
153 25 0
150 32 2
148 34 1
145 35 1
144 34 1
142 34 1
141 33 1
141 33 1
141 33 1
141 33 1
141 33 1
139 33 1
139 33 1
138 33 1
136 22 6
134 31 1
134 31 1
134 31 1
134 31 1
132 41 3
132 31 1
132 31 1
129 32 1
128 26 1
118 35 1
117 30 3
116 36 5
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."