golang / arch
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 528 units with 14,133 lines of code in units (30.2% of code).
    • 26 very long units (8,021 lines of code)
    • 31 long units (2,034 lines of code)
    • 53 medium size units (1,664 lines of code)
    • 72 small units (1,067 lines of code)
    • 346 very small units (1,347 lines of code)
56% | 14% | 11% | 7% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go56% | 14% | 11% | 7% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
arm64/arm64asm74% | 2% | 9% | 2% | 10%
x86/x86asm83% | 4% | 2% | 4% | 4%
x86/x86spec48% | 18% | 4% | 16% | 12%
arm/armasm56% | 13% | 17% | 4% | 7%
x86/x86map49% | 17% | 16% | 10% | 5%
arm64/arm64spec69% | 22% | 0% | 2% | 5%
ppc64/ppc64asm48% | 13% | 21% | 3% | 12%
ppc64/ppc64map47% | 21% | 15% | 2% | 12%
arm/armspec30% | 44% | 15% | 4% | 5%
arm/armmap56% | 17% | 17% | 3% | 4%
ppc64/ppc64spec29% | 56% | 0% | 4% | 9%
x86/x86avxgen0% | 36% | 28% | 22% | 11%
x86/xeddata0% | 16% | 31% | 26% | 26%
ppc64/ppc64util0% | 0% | 66% | 23% | 9%
x86/x86csv0% | 0% | 0% | 74% | 25%
arm64/arm64gen0% | 0% | 0% | 44% | 55%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func decodeArg()
in arm64/arm64asm/decode.go
2220 860 2
func decode1()
in x86/x86asm/decode.go
974 321 3
func GoSyntax()
in arm64/arm64asm/plan9x.go
390 171 3
func GNUSyntax()
in x86/x86asm/gnu.go
370 158 3
func IntelSyntax()
in x86/x86asm/intel.go
297 120 3
func decodeArg()
in arm/armasm/decode.go
278 94 2
func add()
in ppc64/ppc64map/map.go
272 70 5
func cleanup()
in x86/x86spec/cleanup.go
270 120 1
func GNUSyntax()
in ppc64/ppc64asm/gnu.go
269 75 2
func parsePage()
in arm64/arm64spec/spec.go
236 82 3
func parsePage()
in arm/armspec/spec.go
202 79 2
func plan9Arg()
in arm64/arm64asm/plan9x.go
197 61 3
func add()
in arm/armmap/map.go
194 54 6
func add()
in x86/x86map/map.go
189 69 7
func processListing()
in x86/x86spec/parse.go
184 54 2
func readBitBox()
in arm64/arm64spec/spec.go
170 67 4
func printDecoderPass()
in x86/x86map/map.go
167 59 4
func gnuArg()
in x86/x86asm/gnu.go
160 63 5
func emitScanFunc()
in x86/x86map/map.go
141 44 2
func intelArg()
in x86/x86asm/intel.go
141 54 4