bazelbuild / rules_rust
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 116 units with 3,101 lines of code in units (17.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (172 lines of code)
    • 6 medium complex units (422 lines of code)
    • 9 simple units (297 lines of code)
    • 100 very simple units (2,210 lines of code)
0% | 5% | 13% | 9% | 71%
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
cc0% | 28% | 32% | 17% | 21%
rs0% | 0% | 9% | 7% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
util/process_wrapper0% | 28% | 32% | 17% | 21%
cargo/cargo_build_script_runner0% | 0% | 33% | 5% | 60%
util/label0% | 0% | 19% | 10% | 69%
crate_universe/src0% | 0% | 5% | 9% | 85%
tools/rust_analyzer0% | 0% | 0% | 10% | 89%
tools/rustdoc0% | 0% | 0% | 0% | 100%
tools/rustfmt0% | 0% | 0% | 0% | 100%
tools/runfiles0% | 0% | 0% | 0% | 100%
util/dir_zipper0% | 0% | 0% | 0% | 100%
proto0% | 0% | 0% | 0% | 100%
cargo/bootstrap0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
int PW_MAIN()
in util/process_wrapper/process_wrapper.cc
172 42 3
int System::Exec()
in util/process_wrapper/system_posix.cc
68 20 5
fn consume_package_name)>()
in util/label/label.rs
67 16 1
int System::Exec()
in util/process_wrapper/system_windows.cc
85 15 5
fn run_buildrs()
in cargo/cargo_build_script_runner/bin.rs
124 14 0
fn build_version_mapping_for_kind()
in crate_universe/src/resolver.rs
39 12 3
bool ReadFileToArray()
in util/process_wrapper/utils.cc
39 11 2
fn consume_repository_name()
in util/label/label.rs
37 9 2
fn parse_config()
in tools/rust_analyzer/main.rs
38 9 0
void ArgumentQuote()
in util/process_wrapper/system_windows.cc
27 8 2
fn parse_rustc_cfg_output()
in cargo/cargo_build_script_runner/bin.rs
22 8 1
bool WriteToFile()
in util/process_wrapper/system_posix.cc
33 7 1
bool WriteToFile()
in util/process_wrapper/system_windows.cc
44 6 1
fn consolidate_crate_specs()
in tools/rust_analyzer/aquery.rs
22 6 1
fn main()
in crate_universe/src/main.rs
20 6 0
fn from()
in crate_universe/src/parser.rs
54 6 1
fn consume_name>()
in util/label/label.rs
19 5 0
fn apply_rustfmt()
in tools/rustfmt/srcs/main.rs
30 5 2
fn extra_deps_as_targeted_deps()
in crate_universe/src/consolidator.rs
72 5 5
fn ensure()
in proto/optional_output_wrapper.rs
22 5 0