golang / groupcache
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 144 units with 1,004 lines of code in units (74.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (194 lines of code)
    • 18 small units (239 lines of code)
    • 119 very small units (571 lines of code)
0% | 0% | 19% | 23% | 56%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 0% | 19% | 23% | 56%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 24% | 28% | 46%
singleflight0% | 0% | 100% | 0% | 0%
consistenthash0% | 0% | 0% | 62% | 37%
lru0% | 0% | 0% | 21% | 78%
testpb0% | 0% | 0% | 0% | 100%
groupcachepb0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in http.go
37 7 1
func()
in http.go
37 7 1
func()
in groupcache.go
33 6 1
func newGroup()
in groupcache.go
23 4 4
22 5 2
func()
in groupcache.go
21 5 1
func()
in singleflight/singleflight.go
21 3 1
func()
in groupcache.go
18 5 1
func()
in groupcache.go
16 3 1
func()
in lru/lru.go
16 5 1
func()
in groupcache.go
15 2 1
func()
in byteview.go
15 5 1
func()
in byteview.go
15 5 1
func()
in groupcache.go
14 3 1
func()
in sinks.go
13 3 1
func()
in byteview.go
13 4 1
func()
in byteview.go
13 4 1
12 3 2
func()
in sinks.go
12 3 1
func()
in sinks.go
12 3 1