bazelbuild / rules_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 160 units with 2,580 lines of code in units (21.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (77 lines of code)
    • 7 medium complex units (410 lines of code)
    • 34 simple units (1,059 lines of code)
    • 118 very simple units (1,034 lines of code)
0% | 2% | 15% | 41% | 40%
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
py0% | 9% | 21% | 29% | 40%
go0% | 0% | 13% | 47% | 39%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
container0% | 3% | 19% | 37% | 39%
docker0% | 0% | 0% | 47% | 52%
contrib0% | 0% | 0% | 78% | 21%
testing0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in container/build_tar.py
77 28 1
func updateConfig()
in container/go/pkg/compat/config.go
83 25 1
def add_file()
in container/archive.py
60 16 12
func main()
in container/go/cmd/pusher/pusher.go
54 16 0
def add_tar()
in container/archive.py
73 14 7
func()
in container/go/pkg/compat/reader.go
42 13 1
func main()
in container/go/cmd/zipper/zipper.go
51 12 0
def add_dir()
in container/archive.py
47 11 10
func main()
in container/go/cmd/create_image_config/create_image_config.go
67 10 0
func main()
in container/go/cmd/digester/digester.go
31 10 0
func main()
in container/go/cmd/flattener/flattener.go
36 10 0
func main()
in contrib/go/cmd/metadata_merge/metadata_merge.go
40 10 0
func main()
in container/go/cmd/extract_config/extract_config.go
30 9 0
func push()
in container/go/cmd/pusher/pusher.go
38 9 2
func updateConfigLayers()
in container/go/pkg/compat/config.go
37 9 3
def strip_config()
in docker/util/config_stripper.py
24 9 2
func newPackagesMetadataFromCSV()
in contrib/go/cmd/packages_metadata/packages_metadata.go
33 9 1
func main()
in container/go/cmd/update_deps/update_deps.go
43 8 0
func writeOutput()
in container/go/cmd/join_layers/join_layers.go
37 8 6
func writeImageLayer()
in container/go/pkg/compat/write.go
35 8 3