microsoft / redplex
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 46 units with 772 lines of code in units (80.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 14 medium size units (437 lines of code)
    • 14 small units (222 lines of code)
    • 18 very small units (113 lines of code)
0% | 0% | 56% | 28% | 14%
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% | 56% | 28% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 0% | 51% | 32% | 15%
cmd/bench0% | 0% | 82% | 17% | 0%
cmd/redplex0% | 0% | 75% | 0% | 24%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in server.go
48 13 1
func runBenchmark()
in cmd/bench/bench.go
47 7 1
func main()
in cmd/redplex/redplex.go
44 7 0
func ReadNextFull()
in protocol.go
41 13 2
func()
in dialer.go
32 9 1
func ParseRequest()
in protocol.go
30 8 1
func()
in pubsub.go
28 5 1
func()
in dialer.go
27 7 1
func()
in pubsub.go
27 7 1
func()
in pubsub.go
25 6 1
func()
in dialer.go
23 5 1
func main()
in cmd/bench/bench.go
22 3 0
func()
in pubsub.go
22 5 1
func()
in dialer.go
21 5 1
func()
in pubsub.go
20 5 1
func()
in pubsub.go
19 5 1
18 5 1
func()
in server.go
18 5 1
func()
in dialer.go
17 4 1
17 5 1