Unit Size Overall
  • There are 37,258 units with 432,629 lines of code in units (59.6% of code).
    • 217 very long units (33,156 lines of code)
    • 812 long units (54,387 lines of code)
    • 4,089 medium size units (125,049 lines of code)
    • 6,702 small units (96,966 lines of code)
    • 25,438 very small units (123,071 lines of code)
7% | 12% | 28% | 22% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 12% | 28% | 22% | 28%
cc23% | 20% | 28% | 14% | 12%
cpp0% | 0% | 67% | 30% | 1%
h0% | 0% | 0% | 31% | 68%
pyi0% | 0% | 0% | 11% | 88%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
common6% | 13% | 32% | 22% | 25%
openfold3_ob09% | 10% | 27% | 21% | 31%
openfold38% | 11% | 28% | 21% | 30%
protenix_v27% | 14% | 28% | 23% | 26%
af3_jax11% | 11% | 26% | 18% | 31%
opendde6% | 13% | 27% | 20% | 31%
pxdesign9% | 11% | 24% | 22% | 32%
boltz27% | 13% | 28% | 23% | 25%
esmfold26% | 17% | 29% | 20% | 26%
proteinmpnn26% | 13% | 23% | 17% | 19%
atlasfold7% | 15% | 28% | 19% | 28%
colabfold15% | 10% | 28% | 20% | 25%
protenix_v18% | 18% | 28% | 20% | 23%
rfdiffusion114% | 12% | 23% | 27% | 22%
ef2inv11% | 9% | 28% | 21% | 28%
genie316% | 12% | 24% | 17% | 29%
colabdesign7% | 14% | 32% | 20% | 25%
af3_torch5% | 9% | 32% | 26% | 24%
chai14% | 8% | 24% | 25% | 37%
flashzoi11% | 11% | 26% | 22% | 28%
af2ig8% | 14% | 35% | 17% | 24%
mosaic5% | 7% | 25% | 25% | 35%
boltzgen7% | 14% | 26% | 22% | 27%
rosettafold33% | 15% | 27% | 27% | 26%
borzoi16% | 12% | 26% | 20% | 24%
chrombpnet5% | 13% | 27% | 21% | 31%
evo23% | 12% | 33% | 25% | 25%
esmc5% | 12% | 23% | 26% | 32%
complexa8% | 3% | 33% | 27% | 27%
enformer_deepmind6% | 3% | 32% | 36% | 20%
gpnstar4% | 5% | 45% | 24% | 21%
progen23% | 11% | 28% | 23% | 33%
e12% | 6% | 28% | 31% | 32%
rfdiffusion30% | 11% | 34% | 23% | 30%
caliby0% | 4% | 24% | 29% | 40%
esm_if10% | 13% | 21% | 22% | 42%
enformer0% | 7% | 30% | 28% | 33%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
518 58 10
479 33 0
476 301 8
432 285 2
426 266 14
374 107 8
368 98 1
339 70 15
318 241 3
306 84 1
305 162 1
304 52 2
294 54 2
280 23 1
262 144 5
254 51 1
247 41 1
244 72 11
236 90 0
235 35 4
235 61 4
229 76 0
225 2 0
223 56 9
219 9 0
215 10 1
213 60 2
211 20 1
206 38 1
206 38 1
205 23 7
205 31 0
204 98 0
203 27 1
198 58 1
192 69 1
191 21 5
188 51 15
186 39 0
185 76 23
183 47 17
181 36 0
179 38 16
178 60 3
178 60 3
174 42 3
171 98 16
166 84 0
166 38 16
165 34 10
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."