bazelbuild / rules_docker
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 160 units with 2,580 lines of code in units (21.4% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (526 lines of code)
    • 33 medium size units (1,056 lines of code)
    • 43 small units (613 lines of code)
    • 76 very small units (385 lines of code)
0% | 20% | 40% | 23% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 31% | 32% | 21% | 14%
go0% | 14% | 45% | 24% | 15%
java0% | 0% | 0% | 66% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
container0% | 22% | 39% | 22% | 15%
docker0% | 20% | 27% | 37% | 14%
contrib0% | 0% | 78% | 16% | 5%
testing0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func updateConfig()
in container/go/pkg/compat/config.go
83 25 1
def main()
in container/build_tar.py
77 28 1
def add_tar()
in container/archive.py
73 14 7
func main()
in container/go/cmd/create_image_config/create_image_config.go
67 10 0
def strip_layer()
in docker/util/config_stripper.py
61 3 1
def add_file()
in container/archive.py
60 16 12
func main()
in container/go/cmd/pusher/pusher.go
54 16 0
func main()
in container/go/cmd/zipper/zipper.go
51 12 0
func()
in container/go/pkg/oci/image.go
48 8 1
def add_dir()
in container/archive.py
47 11 10
func()
in container/go/pkg/compat/image.go
46 7 1
func main()
in container/go/cmd/puller/puller.go
44 7 0
func main()
in container/go/cmd/update_deps/update_deps.go
43 8 0
func()
in container/go/pkg/compat/reader.go
42 13 1
def extract_last_layer()
in contrib/extract_last_layer.py
42 6 3
func main()
in contrib/go/cmd/metadata_merge/metadata_merge.go
40 10 0
func push()
in container/go/cmd/pusher/pusher.go
38 9 2
func writeOutput()
in container/go/cmd/join_layers/join_layers.go
37 8 6
func updateConfigLayers()
in container/go/pkg/compat/config.go
37 9 3
func main()
in container/go/cmd/flattener/flattener.go
36 10 0