golang / snappy
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 30 units with 616 lines of code in units (21.9% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (301 lines of code)
    • 5 medium size units (141 lines of code)
    • 7 small units (91 lines of code)
    • 14 very small units (83 lines of code)
0% | 48% | 22% | 14% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 44% | 24% | 16% | 14%
cpp0% | 100% | 0% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 46% | 22% | 16% | 14%
misc0% | 100% | 0% | 0% | 0%
cmd/snappytool0% | 0% | 77% | 0% | 22%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in decode.go
99 26 1
func decode()
in decode_other.go
88 25 2
func encodeBlock()
in encode_other.go
63 13 2
int main()
in misc/main.cpp
51 12 2
func()
in encode.go
49 9 1
func emitCopy()
in encode_other.go
26 5 3
func()
in encode.go
24 6 1
func run()
in cmd/snappytool/main.go
21 5 0
func Encode()
in encode.go
21 6 2
func emitLiteral()
in encode_other.go
18 3 2
func Decode()
in decode.go
18 5 2
11 3 1
func()
in encode.go
11 3 1
func decodedLen()
in decode.go
11 4 1
func()
in decode.go
11 3 1
func()
in decode.go
11 3 1
func()
in decode.go
9 5 1
func()
in encode.go
8 2 1
func()
in encode.go
8 2 1
7 1 1