Unit Size Overall
  • There are 1,842 units with 33,801 lines of code in units (33.8% of code).
    • 29 very long units (6,783 lines of code)
    • 82 long units (5,384 lines of code)
    • 310 medium size units (9,628 lines of code)
    • 473 small units (6,945 lines of code)
    • 948 very small units (5,061 lines of code)
20% | 15% | 28% | 20% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx26% | 19% | 22% | 20% | 10%
ts18% | 11% | 34% | 20% | 15%
js30% | 24% | 18% | 16% | 11%
py4% | 15% | 33% | 20% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
25-realtime-232% | 14% | 24% | 16% | 11%
27-valuemaxxing23% | 12% | 37% | 11% | 15%
16-built-in-tools35% | 14% | 18% | 24% | 7%
21-agentic-memory7% | 12% | 32% | 30% | 16%
24-api-codex19% | 29% | 27% | 12% | 10%
07-reasoning53% | 0% | 20% | 8% | 17%
26-agents-sdk15% | 18% | 9% | 19% | 36%
18-responses-api14% | 9% | 29% | 21% | 24%
13-image-gen47% | 0% | 32% | 13% | 5%
11-recommendation33% | 26% | 28% | 4% | 6%
22-chatgptapp-pingpong86% | 0% | 0% | 0% | 13%
14-voice-agents8% | 29% | 35% | 17% | 9%
09-realtime0% | 52% | 17% | 18% | 11%
05-4o_fine_tuning0% | 36% | 39% | 11% | 11%
06-structured_outputs0% | 10% | 37% | 44% | 7%
04-mmrag_tooluse0% | 17% | 45% | 18% | 17%
12-agentic-tool-calling0% | 29% | 13% | 18% | 39%
15-reinforcement-fine-tuning0% | 0% | 49% | 23% | 27%
02-assistants0% | 0% | 54% | 14% | 31%
20-agent-rft0% | 0% | 33% | 40% | 26%
17-gpt-50% | 0% | 44% | 33% | 21%
03-4o_mini_fine_tuning0% | 0% | 0% | 92% | 7%
08-evals0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
764 70 0
661 112 0
486 55 0
424 55 0
339 87 4
334 87 4
298 28 0
277 49 7
233 13 0
214 17 13
209 16 7
208 12 20
204 42 0
173 30 6
169 27 0
163 1 0
162 28 0
155 9 3
155 19 8
141 29 2
125 7 1
120 1 0
115 14 2
115 20 2
110 18 3
110 9 4
108 5 5
106 24 0
105 17 1
100 4 10
98 8 0
98 10 6
95 15 8
90 1 0
90 12 1
87 19 1
86 11 8
86 20 2
84 9 1
83 5 1
83 5 5
82 2 0
82 8 7
82 10 2
81 10 7
78 12 1
77 12 1
77 34 1
74 12 0
72 1 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."