bottlerocket-os / bottlerocket
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 1,161 units with 15,318 lines of code in units (30.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (192 lines of code)
    • 4 medium complex units (344 lines of code)
    • 40 simple units (1,765 lines of code)
    • 1,116 very simple units (13,017 lines of code)
0% | 1% | 2% | 11% | 84%
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
go0% | 23% | 8% | 20% | 48%
rs0% | 0% | 1% | 11% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sources/host-ctr0% | 23% | 8% | 20% | 48%
sources/api0% | 0% | 2% | 14% | 82%
tools/pubsys-setup0% | 0% | 54% | 0% | 45%
sources/updater0% | 0% | 0% | 17% | 82%
tools/buildsys0% | 0% | 0% | 16% | 83%
sources/logdog0% | 0% | 0% | 14% | 85%
tools/pubsys0% | 0% | 0% | 4% | 95%
sources/growpart0% | 0% | 0% | 22% | 77%
sources/models0% | 0% | 0% | 0% | 100%
tools/infrasys0% | 0% | 0% | 0% | 100%
sources/driverdog0% | 0% | 0% | 0% | 100%
sources/prairiedog0% | 0% | 0% | 0% | 100%
sources/metricdog0% | 0% | 0% | 0% | 100%
sources/imdsclient0% | 0% | 0% | 0% | 100%
sources/ghostdog0% | 0% | 0% | 0% | 100%
sources/retry-read0% | 0% | 0% | 0% | 100%
sources/shimpei0% | 0% | 0% | 0% | 100%
sources/parse-datetime0% | 0% | 0% | 0% | 100%
tools/pubsys-config0% | 0% | 0% | 0% | 100%
sources/webpki-roots-shim0% | 0% | 0% | 0% | 100%
sources/bottlerocket-release0% | 0% | 0% | 0% | 100%
sources/constants0% | 0% | 0% | 0% | 100%
packages/os0% | 0% | 0% | 0% | 100%
variants/aws-k8s-1.210% | 0% | 0% | 0% | 100%
variants/aws-k8s-1.180% | 0% | 0% | 0% | 100%
variants/aws-ecs-10% | 0% | 0% | 0% | 100%
variants/metal-dev0% | 0% | 0% | 0% | 100%
variants/metal-k8s-1.210% | 0% | 0% | 0% | 100%
variants/vmware-k8s-1.200% | 0% | 0% | 0% | 100%
variants/vmware-dev0% | 0% | 0% | 0% | 100%
variants/aws-k8s-1.190% | 0% | 0% | 0% | 100%
variants/aws-k8s-1.200% | 0% | 0% | 0% | 100%
variants/vmware-k8s-1.210% | 0% | 0% | 0% | 100%
variants/aws-k8s-1.21-nvidia0% | 0% | 0% | 0% | 100%
variants/aws-dev0% | 0% | 0% | 0% | 100%
packages/nvidia-k8s-device-plugin0% | 0% | 0% | 0% | 100%
packages/open-vm-tools0% | 0% | 0% | 0% | 100%
packages/libnetfilter_conntrack0% | 0% | 0% | 0% | 100%
packages/ecs-agent0% | 0% | 0% | 0% | 100%
packages/ncurses0% | 0% | 0% | 0% | 100%
packages/wicked0% | 0% | 0% | 0% | 100%
packages/libpcre0% | 0% | 0% | 0% | 100%
packages/dbus-broker0% | 0% | 0% | 0% | 100%
packages/libmnl0% | 0% | 0% | 0% | 100%
packages/makedumpfile0% | 0% | 0% | 0% | 100%
packages/filesystem0% | 0% | 0% | 0% | 100%
packages/util-linux0% | 0% | 0% | 0% | 100%
packages/libelf0% | 0% | 0% | 0% | 100%
packages/log4j2-hotpatch0% | 0% | 0% | 0% | 100%
packages/coreutils0% | 0% | 0% | 0% | 100%
packages/libselinux0% | 0% | 0% | 0% | 100%
packages/libz0% | 0% | 0% | 0% | 100%
packages/grub0% | 0% | 0% | 0% | 100%
packages/libxcrypt0% | 0% | 0% | 0% | 100%
packages/bash0% | 0% | 0% | 0% | 100%
packages/libdbus0% | 0% | 0% | 0% | 100%
packages/strace0% | 0% | 0% | 0% | 100%
packages/findutils0% | 0% | 0% | 0% | 100%
packages/cni-plugins0% | 0% | 0% | 0% | 100%
packages/oci-add-hooks0% | 0% | 0% | 0% | 100%
packages/conntrack-tools0% | 0% | 0% | 0% | 100%
packages/iputils0% | 0% | 0% | 0% | 100%
packages/libnetfilter_queue0% | 0% | 0% | 0% | 100%
packages/login0% | 0% | 0% | 0% | 100%
packages/libnetfilter_cthelper0% | 0% | 0% | 0% | 100%
packages/microcode0% | 0% | 0% | 0% | 100%
packages/libzstd0% | 0% | 0% | 0% | 100%
packages/libbzip20% | 0% | 0% | 0% | 100%
packages/procps0% | 0% | 0% | 0% | 100%
packages/libsemanage0% | 0% | 0% | 0% | 100%
packages/aws-iam-authenticator0% | 0% | 0% | 0% | 100%
packages/libpcap0% | 0% | 0% | 0% | 100%
packages/runc0% | 0% | 0% | 0% | 100%
packages/libattr0% | 0% | 0% | 0% | 100%
packages/e2fsprogs0% | 0% | 0% | 0% | 100%
packages/libnvidia-container0% | 0% | 0% | 0% | 100%
packages/libtirpc0% | 0% | 0% | 0% | 100%
packages/nvidia-container-toolkit0% | 0% | 0% | 0% | 100%
packages/libstd-rust0% | 0% | 0% | 0% | 100%
packages/libglib0% | 0% | 0% | 0% | 100%
packages/docker-proxy0% | 0% | 0% | 0% | 100%
packages/ca-certificates0% | 0% | 0% | 0% | 100%
packages/libnl0% | 0% | 0% | 0% | 100%
packages/kmod0% | 0% | 0% | 0% | 100%
packages/binutils0% | 0% | 0% | 0% | 100%
packages/docker-cli0% | 0% | 0% | 0% | 100%
packages/docker-engine0% | 0% | 0% | 0% | 100%
packages/selinux-policy0% | 0% | 0% | 0% | 100%
packages/libseccomp0% | 0% | 0% | 0% | 100%
packages/libacl0% | 0% | 0% | 0% | 100%
packages/libnftnl0% | 0% | 0% | 0% | 100%
packages/systemd0% | 0% | 0% | 0% | 100%
packages/cni0% | 0% | 0% | 0% | 100%
packages/libaudit0% | 0% | 0% | 0% | 100%
packages/release0% | 0% | 0% | 0% | 100%
packages/kexec-tools0% | 0% | 0% | 0% | 100%
packages/libcap0% | 0% | 0% | 0% | 100%
packages/libnfnetlink0% | 0% | 0% | 0% | 100%
packages/libffi0% | 0% | 0% | 0% | 100%
packages/libsepol0% | 0% | 0% | 0% | 100%
packages/tcpdump0% | 0% | 0% | 0% | 100%
packages/iptables0% | 0% | 0% | 0% | 100%
packages/libgcc0% | 0% | 0% | 0% | 100%
packages/libexpat0% | 0% | 0% | 0% | 100%
packages/glibc0% | 0% | 0% | 0% | 100%
packages/libnetfilter_cttimeout0% | 0% | 0% | 0% | 100%
packages/acpid0% | 0% | 0% | 0% | 100%
packages/host-ctr0% | 0% | 0% | 0% | 100%
packages/hotdog0% | 0% | 0% | 0% | 100%
packages/policycoreutils0% | 0% | 0% | 0% | 100%
packages/kmod-5.10-nvidia0% | 0% | 0% | 0% | 100%
packages/iproute0% | 0% | 0% | 0% | 100%
packages/docker-init0% | 0% | 0% | 0% | 100%
packages/grep0% | 0% | 0% | 0% | 100%
packages/chrony0% | 0% | 0% | 0% | 100%
packages/libiw0% | 0% | 0% | 0% | 100%
packages/containerd0% | 0% | 0% | 0% | 100%
packages/readline0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func runCtr()
in sources/host-ctr/cmd/host-ctr/main.go
192 37 7
fn find_root_role_and_key()
in tools/pubsys-setup/src/main.rs
99 16 1
fn populate_default_datastore>()
in sources/api/storewolf/src/main.rs
119 13 2
fn parse_set_args()
in sources/api/apiclient/src/main.rs
61 12 1
func withDynamicResolver()
in sources/host-ctr/cmd/host-ctr/main.go
65 11 3
fn handle_host_container()
in sources/api/host-containers/src/main.rs
74 10 2
func cleanUp()
in sources/host-ctr/cmd/host-ctr/main.go
45 10 3
func pullImage()
in sources/host-ctr/cmd/host-ctr/main.go
53 10 4
func registryHosts()
in sources/host-ctr/cmd/host-ctr/main.go
42 10 2
fn parse_exec_args()
in sources/api/apiclient/src/main.rs
30 9 1
fn parse_get_args()
in sources/api/apiclient/src/main.rs
32 9 1
fn parse_args()
in sources/api/thar-be-updates/src/main.rs
37 9 1
fn deserialize_struct()
in sources/api/datastore/src/deserialization/pairs.rs
111 9 4
fn handle_glob_request()
in sources/logdog/src/log_request.rs
40 9 2
fn build_package()
in tools/buildsys/src/main.rs
47 9 0
fn parse_args()
in sources/api/settings-committer/src/main.rs
36 8 1
fn delete_key_path()
in sources/api/datastore/src/filesystem.rs
35 8 3
fn parse_args()
in sources/api/servicedog/src/main.rs
37 8 1
fn wait()
in sources/growpart/src/diskpart.rs
26 8 1
fn parse_args()
in sources/updater/updog/src/main.rs
65 8 1