firecracker-microvm / firecracker
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,683 units with 29,992 lines of code in units (55.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 9 medium complex units (782 lines of code)
    • 32 simple units (1,357 lines of code)
    • 1,642 very simple units (27,853 lines of code)
0% | 0% | 2% | 4% | 92%
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
rs0% | 0% | 2% | 4% | 92%
py0% | 0% | 0% | 26% | 73%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/devices0% | 0% | 5% | 7% | 87%
src/firecracker0% | 0% | 54% | 6% | 39%
src/arch0% | 0% | 3% | 3% | 92%
src/utils0% | 0% | 3% | 5% | 91%
src/vmm0% | 0% | 0% | 5% | 94%
src/mmds0% | 0% | 0% | 11% | 88%
src/dumbo0% | 0% | 0% | 3% | 96%
src/jailer0% | 0% | 0% | 2% | 97%
tools/parse_baselines0% | 0% | 0% | 26% | 73%
src/cpuid0% | 0% | 0% | 2% | 97%
src/logger0% | 0% | 0% | 4% | 95%
src/seccompiler0% | 0% | 0% | 0% | 100%
src/api_server0% | 0% | 0% | 0% | 100%
src/net_gen0% | 0% | 0% | 0% | 100%
src/arch_gen0% | 0% | 0% | 0% | 100%
src/rate_limiter0% | 0% | 0% | 0% | 100%
src/io_uring0% | 0% | 0% | 0% | 100%
src/virtio_gen0% | 0% | 0% | 0% | 100%
src/snapshot0% | 0% | 0% | 0% | 100%
src/vm-memory0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
fn send_pkt()
in src/devices/src/virtio/vsock/csm/connection.rs
73 18 3
fn create_cpu_nodes()
in src/arch/src/aarch64/fdt.rs
70 16 2
fn apply_conn_mutation()
in src/devices/src/virtio/vsock/unix/muxer.rs
76 12 3
fn main_exitable()
in src/firecracker/src/main.rs
264 12 0
fn set_device_status()
in src/devices/src/virtio/mmio.rs
52 11 2
fn recv_pkt()
in src/devices/src/virtio/vsock/csm/connection.rs
78 11 3
fn process_tx()
in src/devices/src/virtio/net/device.rs
84 11 1
fn write()
in src/devices/src/legacy/i8042.rs
58 11 3
fn validate_requirements()
in src/utils/src/arg_parser.rs
27 11 2
fn do_random_request_parse()
in src/devices/src/virtio/block/request.rs
116 10 6
fn is_ap_reg_available()
in src/arch/src/aarch64/gic/gicv3/regs/icc_regs.rs
14 9 2
fn do_write_frame_to_guest()
in src/devices/src/virtio/net/device.rs
56 9 1
fn process()
in src/devices/src/virtio/net/event_handler.rs
37 9 3
fn process()
in src/devices/src/legacy/serial.rs
55 9 3
fn dump_dirty()
in src/vmm/src/memory_snapshot.rs
52 9 3
fn process()
in src/devices/src/virtio/balloon/event_handler.rs
42 8 3
fn notify()
in src/devices/src/virtio/vsock/csm/connection.rs
35 8 2
fn process()
in src/devices/src/virtio/vsock/event_handler.rs
32 8 3
170 8 0
fn restore()
in src/vmm/src/device_manager/persist.rs
130 8 2