golang / sync
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 29 units with 390 lines of code in units (79.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (183 lines of code)
    • 8 small units (120 lines of code)
    • 14 very small units (87 lines of code)
0% | 0% | 46% | 30% | 22%
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% | 46% | 30% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
syncmap0% | 0% | 47% | 35% | 17%
singleflight0% | 0% | 57% | 21% | 20%
semaphore0% | 0% | 48% | 20% | 31%
errgroup0% | 0% | 0% | 56% | 44%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in semaphore/semaphore.go
36 9 1
func()
in syncmap/pre_go19.go
29 7 1
func()
in singleflight/singleflight.go
27 8 1
func()
in syncmap/pre_go19.go
23 7 1
func()
in syncmap/pre_go19.go
23 6 1
func()
in singleflight/singleflight.go
23 5 1
func()
in syncmap/pre_go19.go
22 7 1
func()
in singleflight/singleflight.go
19 3 1
func()
in syncmap/pre_go19.go
18 6 1
func()
in syncmap/pre_go19.go
16 6 1
func()
in syncmap/pre_go19.go
15 5 1
func()
in semaphore/semaphore.go
15 4 1
func()
in errgroup/errgroup.go
14 3 1
func()
in syncmap/pre_go19.go
12 4 1
func()
in syncmap/pre_go19.go
11 5 1
func()
in syncmap/pre_go19.go
10 3 1
func()
in semaphore/semaphore.go
10 2 1
func()
in syncmap/pre_go19.go
9 2 1
func()
in semaphore/semaphore.go
9 3 1
func()
in singleflight/singleflight.go
8 2 1