golang / appengine
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 8,148 units with 38,970 lines of code in units (69.2% of code).
    • 6 very long units (1,200 lines of code)
    • 49 long units (3,454 lines of code)
    • 158 medium size units (4,777 lines of code)
    • 197 small units (2,979 lines of code)
    • 7,738 very small units (26,560 lines of code)
3% | 8% | 12% | 7% | 68%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go3% | 8% | 12% | 7% | 68%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
v23% | 9% | 12% | 8% | 66%
cmd28% | 20% | 28% | 7% | 14%
aetest43% | 0% | 13% | 27% | 14%
datastore0% | 26% | 34% | 19% | 20%
internal0% | 1% | 2% | 2% | 93%
search0% | 22% | 54% | 11% | 12%
blobstore0% | 34% | 17% | 27% | 19%
remote_api0% | 36% | 43% | 0% | 20%
urlfetch0% | 58% | 0% | 15% | 26%
taskqueue0% | 19% | 41% | 25% | 13%
memcache0% | 21% | 33% | 12% | 32%
socket0% | 25% | 22% | 25% | 25%
delay0% | 32% | 54% | 0% | 13%
log0% | 33% | 24% | 26% | 16%
xmpp0% | 0% | 54% | 29% | 16%
mail0% | 0% | 82% | 0% | 17%
runtime0% | 0% | 33% | 28% | 37%
user0% | 0% | 0% | 58% | 41%
ROOT0% | 0% | 0% | 41% | 58%
module0% | 0% | 0% | 66% | 33%
image0% | 0% | 0% | 66% | 33%
capability0% | 0% | 0% | 100% | 0%
channel0% | 0% | 0% | 0% | 100%
file0% | 0% | 0% | 0% | 100%
cloudsql0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func typecheck1()
in cmd/aefix/typecheck.go
275 104 4
func typecheck1()
in v2/cmd/aefix/typecheck.go
275 104 4
func walkBeforeAfter()
in cmd/aefix/fix.go
210 89 3
func walkBeforeAfter()
in v2/cmd/aefix/fix.go
210 89 3
func()
in aetest/instance_vm.go
117 34 1
func()
in v2/aetest/instance.go
113 33 1
func setVal()
in datastore/load.go
98 39 2
func getStructCodecLocked()
in datastore/prop.go
98 31 1
func setVal()
in v2/datastore/load.go
98 39 2
func getStructCodecLocked()
in v2/datastore/prop.go
98 31 1
func aeFn()
in cmd/aefix/ae.go
93 30 1
func aeFn()
in v2/cmd/aefix/ae.go
93 30 1
func ParseUpload()
in v2/blobstore/blobstore.go
92 24 1
func ParseUpload()
in blobstore/blobstore.go
92 24 1
func Call()
in v2/internal/api.go
88 23 5
func Call()
in internal/api.go
88 23 5
func()
in datastore/load.go
84 26 1
func()
in v2/datastore/load.go
84 26 1
func propertiesToProto()
in datastore/save.go
79 25 3
func propertiesToProto()
in v2/datastore/save.go
79 25 3