fbsamples / fbrell
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • 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...
Unit Size Overall
  • There are 91 units with 1,319 lines of code in units (73.7% of code).
    • 1 very long units (119 lines of code)
    • 2 long units (156 lines of code)
    • 16 medium size units (506 lines of code)
    • 16 small units (232 lines of code)
    • 56 very small units (306 lines of code)
9% | 11% | 38% | 17% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go10% | 14% | 41% | 18% | 14%
js0% | 0% | 19% | 12% | 68%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT90% | 0% | 0% | 0% | 9%
og/viewog0% | 43% | 39% | 8% | 8%
rellenv0% | 33% | 13% | 21% | 31%
og0% | 0% | 54% | 26% | 18%
oauth0% | 0% | 76% | 18% | 6%
view0% | 0% | 74% | 15% | 10%
public/js0% | 0% | 19% | 12% | 68%
web0% | 0% | 68% | 24% | 7%
rellenv/empcheck0% | 0% | 100% | 0% | 0%
rellenv/appns0% | 0% | 100% | 0% | 0%
adminweb0% | 0% | 0% | 80% | 20%
rellenv/viewcontext0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in main.go
119 5 0
func renderObject()
in og/viewog/og.go
85 2 4
func()
in rellenv/context.go
71 20 1
func()
in og/og.go
47 10 1
func()
in view/view.go
42 1 1
init: function()
in public/js/rell.js
41 7 0
func()
in oauth/oauth.go
39 6 1
func()
in web/web.go
39 3 1
func()
in oauth/oauth.go
37 6 1
func()
in og/og.go
37 9 1
func()
in rellenv/empcheck/empcheck.go
28 6 1
func()
in rellenv/context.go
28 9 1
func()
in og/viewog/og.go
28 8 1
func renderMetaTable()
in og/viewog/og.go
25 2 1
func()
in og/viewog/og.go
24 6 1
24 4 2
23 12 1
func()
in rellenv/appns/appns.go
22 5 1
func()
in view/error.go
22 3 1
func()
in adminweb/adminweb.go
20 3 1