golang / gofrontend
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 17,563 units with 271,832 lines of code in units (63.7% of code).
    • 215 very long units (37,459 lines of code)
    • 747 long units (50,736 lines of code)
    • 2,646 medium size units (82,318 lines of code)
    • 3,447 small units (50,623 lines of code)
    • 10,508 very small units (50,696 lines of code)
13% | 18% | 30% | 18% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go13% | 18% | 30% | 18% | 18%
c30% | 8% | 14% | 13% | 32%
cc0% | 35% | 33% | 20% | 10%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
libgo/go/cmd19% | 24% | 30% | 14% | 10%
libgo/go/go21% | 19% | 26% | 16% | 15%
libgo/go/golang.org12% | 21% | 31% | 18% | 16%
libgo/go/crypto14% | 21% | 31% | 18% | 14%
libgo/go/net8% | 15% | 30% | 22% | 23%
libgo/go/runtime8% | 21% | 31% | 18% | 20%
libgo/go/html50% | 6% | 23% | 8% | 9%
libgo/go/encoding16% | 17% | 26% | 20% | 19%
libgo/go/debug28% | 21% | 26% | 10% | 13%
libgo/go/internal13% | 15% | 30% | 19% | 22%
libgo/go/image18% | 18% | 25% | 21% | 15%
libgo/runtime47% | 9% | 16% | 8% | 17%
libgo/go/regexp20% | 14% | 33% | 16% | 16%
libgo/go/time22% | 12% | 29% | 17% | 18%
libgo/go/syscall10% | 5% | 21% | 25% | 37%
libgo/go/reflect14% | 15% | 26% | 21% | 20%
libgo/go/math5% | 24% | 32% | 19% | 18%
libgo/go/fmt18% | 16% | 24% | 24% | 15%
libgo/go/compress12% | 23% | 33% | 15% | 14%
libgo/go/archive13% | 12% | 36% | 19% | 18%
libgo/go/testing11% | 21% | 28% | 19% | 17%
libgo/go/database9% | 10% | 35% | 21% | 22%
libgo/go/strconv8% | 33% | 35% | 11% | 10%
libgo/go/text0% | 16% | 27% | 25% | 30%
libgo/go/os0% | 10% | 36% | 22% | 29%
libgo/go/path0% | 30% | 34% | 16% | 18%
libgo/go/mime0% | 22% | 39% | 15% | 23%
libgo/go/sort0% | 46% | 14% | 20% | 19%
libgo/go/bytes0% | 17% | 31% | 29% | 21%
go0% | 33% | 32% | 20% | 13%
libgo/go/strings0% | 9% | 50% | 19% | 20%
libgo/go/bufio0% | 11% | 46% | 24% | 16%
libgo/go/plugin0% | 80% | 0% | 0% | 19%
libgo/go/index0% | 4% | 71% | 14% | 9%
libgo/go/flag0% | 12% | 18% | 7% | 62%
libgo/go/sync0% | 5% | 38% | 22% | 33%
libgo/go/log0% | 12% | 18% | 19% | 49%
libgo/go/unicode0% | 0% | 62% | 13% | 24%
libgo/go/io0% | 0% | 30% | 34% | 35%
libgo/go/hash0% | 0% | 17% | 33% | 48%
libgo/go/context0% | 0% | 34% | 26% | 39%
libgo/go/errors0% | 0% | 43% | 29% | 26%
libgo/go/embed0% | 0% | 12% | 65% | 21%
libgo/misc/cgo0% | 0% | 7% | 28% | 63%
libgo/go/expvar0% | 0% | 0% | 34% | 65%
libgo/go/container0% | 0% | 0% | 26% | 73%
libgo/go/builtin0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func populateMaps()
in libgo/go/html/entity.go
2235 1 0
func()
in libgo/go/go/types/builtins.go
565 168 1
func()
in libgo/go/go/types/stmt.go
433 120 1
func()
in libgo/go/go/build/build.go
408 132 1
func scMulAdd()
in libgo/go/crypto/ed25519/internal/edwards25519/scalar.go
400 1 4
func ScMulAdd()
in libgo/go/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go
400 1 4
func heapBitsSetType()
in libgo/go/runtime/mbitmap.go
368 84 4
func()
in libgo/go/cmd/go/internal/work/exec.go
358 115 1
func()
in libgo/go/cmd/cgo/gcc.go
356 100 1
func()
in libgo/go/image/png/reader.go
355 109 1
func runList()
in libgo/go/cmd/go/internal/list/list.go
347 104 3
uintptr aeshashbody()
in libgo/runtime/aeshash.c
334 12 4
func()
in libgo/go/cmd/cgo/gcc.go
328 125 1
func parse()
in libgo/go/time/format.go
321 126 4
func()
in libgo/go/debug/dwarf/entry.go
321 95 1
func()
in libgo/go/debug/dwarf/type.go
315 81 1
func scReduce()
in libgo/go/crypto/ed25519/internal/edwards25519/scalar.go
295 1 2
func ScReduce()
in libgo/go/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go
295 1 2
func forkAndExecInChild1()
in libgo/go/syscall/exec_linux.go
293 91 8
uintptr aeshashbody()
in libgo/runtime/aeshash.c
287 11 4