microsoft / docker
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 3,498 units with 51,260 lines of code in units (78.8% of code).
    • 3 very complex units (714 lines of code)
    • 27 complex units (3,038 lines of code)
    • 202 medium complex units (11,348 lines of code)
    • 432 simple units (12,748 lines of code)
    • 2,834 very simple units (23,412 lines of code)
1% | 5% | 22% | 24% | 45%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go1% | 5% | 22% | 24% | 45%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
runconfig34% | 7% | 6% | 18% | 33%
api2% | 8% | 20% | 27% | 40%
daemon<1% | 8% | 26% | 23% | 40%
pkg0% | 5% | 14% | 22% | 58%
docker0% | 31% | 0% | 26% | 42%
distribution0% | 4% | 42% | 30% | 21%
container0% | 6% | 18% | 20% | 53%
builder0% | 3% | 32% | 30% | 33%
libcontainerd0% | 0% | 32% | 26% | 41%
image0% | 0% | 44% | 16% | 39%
integration-cli0% | 0% | 15% | 18% | 66%
registry0% | 0% | 18% | 43% | 38%
volume0% | 0% | 18% | 20% | 60%
migrate0% | 0% | 54% | 36% | 9%
layer0% | 0% | 13% | 29% | 57%
contrib0% | 0% | 39% | 22% | 37%
restartmanager0% | 0% | 75% | 0% | 24%
opts0% | 0% | 12% | 6% | 80%
cli0% | 0% | 0% | 82% | 17%
reference0% | 0% | 0% | 32% | 67%
profiles0% | 0% | 0% | 54% | 45%
cliconfig0% | 0% | 0% | 20% | 79%
utils0% | 0% | 0% | 51% | 48%
oci0% | 0% | 0% | 0% | 100%
dockerversion0% | 0% | 0% | 0% | 100%
errors0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func verifyContainerResources()
in daemon/daemon_unix.go
144 68 3
func Parse()
in runconfig/opts/parse.go
387 58 2
func()
in api/client/run.go
183 55 1
func UnpackLayer()
in pkg/archive/diff.go
162 48 3
func()
in daemon/graphdriver/devmapper/deviceset.go
148 46 1
func()
in daemon/daemon.go
139 42 1
func()
in docker/daemon.go
174 42 1
func()
in api/client/build.go
191 39 1
func()
in daemon/container_operations.go
165 38 1
func NewDaemon()
in daemon/daemon.go
169 38 3
func setMounts()
in daemon/oci_linux.go
94 38 4
func NewDeviceSet()
in daemon/graphdriver/devmapper/deviceset.go
111 35 5
89 35 2
func createTarFile()
in pkg/archive/archive.go
89 34 6
func()
in api/client/info.go
132 33 1
func()
in daemon/images.go
96 33 1
func Unpack()
in pkg/archive/archive.go
88 33 3
func()
in pkg/archive/changes_linux.go
91 33 1
func TarWithOptions()
in pkg/archive/archive.go
112 32 2
func()
in pkg/mflag/flag.go
78 30 1