microsoft / 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 3,498 units with 51,260 lines of code in units (78.8% of code).
    • 23 very long units (3,409 lines of code)
    • 128 long units (8,905 lines of code)
    • 552 medium size units (17,347 lines of code)
    • 760 small units (11,185 lines of code)
    • 2,035 very small units (10,414 lines of code)
6% | 17% | 33% | 21% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go6% | 17% | 33% | 21% | 20%
c0% | 0% | 60% | 0% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
daemon7% | 19% | 36% | 20% | 16%
api10% | 22% | 32% | 20% | 14%
runconfig34% | 4% | 24% | 16% | 20%
distribution13% | 31% | 33% | 10% | 9%
pkg2% | 9% | 32% | 25% | 29%
docker31% | 0% | 26% | 29% | 13%
oci90% | 0% | 0% | 7% | 2%
libcontainerd7% | 25% | 31% | 18% | 17%
contrib39% | 0% | 42% | 0% | 17%
container7% | 11% | 24% | 28% | 28%
builder0% | 26% | 43% | 17% | 11%
image0% | 30% | 32% | 21% | 15%
integration-cli0% | 15% | 25% | 28% | 30%
migrate0% | 54% | 31% | 12% | 1%
registry0% | 13% | 48% | 24% | 13%
volume0% | 14% | 26% | 30% | 27%
layer0% | 10% | 33% | 28% | 27%
restartmanager0% | 75% | 0% | 0% | 24%
cliconfig0% | 0% | 40% | 26% | 32%
cli0% | 0% | 82% | 0% | 17%
reference0% | 0% | 34% | 35% | 29%
profiles0% | 0% | 69% | 20% | 9%
opts0% | 0% | 23% | 22% | 54%
utils0% | 0% | 30% | 20% | 48%
dockerversion0% | 0% | 0% | 77% | 22%
errors0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func Parse()
in runconfig/opts/parse.go
387 58 2
func()
in api/client/build.go
191 39 1
func()
in api/client/run.go
183 55 1
func()
in docker/daemon.go
174 42 1
func NewDaemon()
in daemon/daemon.go
169 38 3
func()
in daemon/container_operations.go
165 38 1
func UnpackLayer()
in pkg/archive/diff.go
162 48 3
func DefaultSpec()
in oci/defaults_linux.go
155 1 0
func()
in daemon/graphdriver/devmapper/deviceset.go
148 46 1
func()
in api/client/stats.go
147 29 1
func verifyContainerResources()
in daemon/daemon_unix.go
144 68 3
func()
in daemon/daemon.go
139 42 1
func()
in api/client/info.go
132 33 1
func()
in distribution/xfer/download.go
121 23 1
func()
in daemon/oci_windows.go
118 26 1
func()
in distribution/push_v2.go
116 21 1
func()
in distribution/pull_v2.go
115 28 1
func TarWithOptions()
in pkg/archive/archive.go
112 32 2
func NewDeviceSet()
in daemon/graphdriver/devmapper/deviceset.go
111 35 5
func()
in daemon/commit.go
109 24 1