aws-robotics / aws-robomaker-bundle-support-library
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 113 units with 1,087 lines of code in units (76.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (64 lines of code)
    • 10 medium size units (259 lines of code)
    • 24 small units (364 lines of code)
    • 78 very small units (400 lines of code)
0% | 5% | 23% | 33% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 5% | 23% | 33% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/cli0% | 100% | 0% | 0% | 0%
pkg/bundle0% | 0% | 29% | 21% | 49%
pkg/3p/archiver0% | 0% | 31% | 32% | 36%
pkg/stream/s30% | 0% | 24% | 51% | 24%
pkg/store0% | 0% | 17% | 47% | 35%
pkg/stream/local0% | 0% | 0% | 82% | 17%
pkg/fs0% | 0% | 0% | 0% | 100%
pkg/stream0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in cmd/cli/main.go
64 11 0
func tarFile()
in pkg/3p/archiver/tar.go
47 14 3
func()
in pkg/bundle/v2_processor.go
29 7 1
func()
in pkg/bundle/provider.go
28 7 1
func hasTarHeader()
in pkg/3p/archiver/tar.go
27 9 1
func getOverlays()
in pkg/bundle/v2_processor.go
23 7 1
func untarFile()
in pkg/3p/archiver/tar.go
21 7 3
func()
in pkg/store/simple_store.go
21 3 1
func()
in pkg/stream/s3/s3_reader.go
21 6 1
func()
in pkg/stream/s3/s3_reader.go
21 5 1
func()
in pkg/bundle/bundle_v1_extractor.go
21 7 1
func writeNewFile()
in pkg/3p/archiver/archiver.go
20 6 3
func()
in pkg/store/simple_store.go
20 4 1
func()
in pkg/stream/s3/s3_reader.go
20 6 1
func()
in pkg/stream/local/local_file_streamer.go
19 5 1
func isTarGz()
in pkg/3p/archiver/targz.go
18 5 1
func writeNewSymbolicLink()
in pkg/3p/archiver/archiver.go
18 5 2
func writeNewHardLink()
in pkg/3p/archiver/archiver.go
18 5 2
func readVersionFromBundle()
in pkg/bundle/archive.go
18 4 1
func()
in pkg/stream/s3/s3_streamer.go
17 5 1