awslabs / tough
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 244 units with 3,219 lines of code in units (36.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 7 simple units (561 lines of code)
    • 237 very simple units (2,658 lines of code)
0% | 0% | 0% | 17% | 82%
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% | 0% | 17% | 82%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tough/src0% | 0% | 0% | 19% | 80%
tuftool/src0% | 0% | 0% | 20% | 79%
olpc-cjson/src0% | 0% | 0% | 0% | 100%
tough-kms/src0% | 0% | 0% | 0% | 100%
tough-ssm/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
fn sign()
in tuftool/src/root.rs
76 7 4
fn update_metadata()
in tuftool/src/update.rs
61 7 2
fn target_path()
in tough/src/editor/signed.rs
68 7 4
fn load_targets()
in tough/src/lib.rs
97 7 7
fn load_root()
in tough/src/lib.rs
89 6 7
fn load_snapshot()
in tough/src/lib.rs
89 6 6
fn load_delegations()
in tough/src/lib.rs
81 6 7
fn add_key()
in tuftool/src/root.rs
26 5 3
fn update_targets()
in tuftool/src/update_targets.rs
34 5 2
fn clean_name()
in tough/src/target_name.rs
50 5 1
fn matches_target_name()
in tough/src/schema/mod.rs
19 5 2
fn from_str()
in tough/src/schema/key.rs
36 5 1
fn write_number_str()
in olpc-cjson/src/lib.rs
7 4 3
fn remove_key()
in tuftool/src/root.rs
23 4 3
fn main()
in tuftool/src/main.rs
16 4 0
fn supports_range()
in tough/src/http.rs
10 4 1
fn targets()
in tough/src/editor/signed.rs
32 4 1
fn read()
in tough/src/io.rs
24 4 2
fn load_timestamp()
in tough/src/lib.rs
48 4 6
fn end_object()
in olpc-cjson/src/lib.rs
21 3 2