Unit Size Overall
  • There are 627 units with 16,468 lines of code in units (76.8% of code).
    • 21 very long units (5,782 lines of code)
    • 43 long units (3,119 lines of code)
    • 115 medium size units (3,578 lines of code)
    • 156 small units (2,366 lines of code)
    • 292 very small units (1,623 lines of code)
35% | 18% | 21% | 14% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py35% | 18% | 21% | 14% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scripts95% | 0% | 3% | 0% | <1%
data_generation30% | 20% | 27% | 16% | 5%
videox_fun14% | 26% | 24% | 17% | 16%
VLM-MASK-REASONER20% | 21% | 28% | 20% | 9%
inference54% | 22% | 20% | 2% | 0%
config0% | 0% | 22% | 33% | 44%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
986 74 0
883 67 0
616 76 3
452 6 0
435 6 0
312 45 13
280 52 2
261 51 2
182 17 0
141 34 3
141 37 7
134 32 3
113 27 3
111 21 3
108 7 13
108 7 6
107 24 3
107 19 1
102 7 8
102 7 8
101 16 2
99 7 15
99 7 8
98 14 3
96 22 2
96 22 2
92 22 8
86 23 8
85 30 1
85 30 1
85 6 3
84 24 4
84 18 3
83 6 3
82 23 11
80 1 1
79 10 2
78 21 4
76 22 12
76 22 12
76 11 0
72 20 3
71 1 1
70 17 1
70 13 6
68 7 16
68 7 16
67 18 7
67 17 3
67 20 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."