awslabs / rust-smt-ir
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 639 units with 6,382 lines of code in units (53.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (193 lines of code)
    • 21 simple units (885 lines of code)
    • 615 very simple units (5,304 lines of code)
0% | 0% | 3% | 13% | 83%
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% | 13% | 84%
py0% | 0% | 14% | 16% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
amzn-smt-string-transformer/src0% | 0% | 8% | 30% | 61%
amzn-smt-prediction/scripts0% | 0% | 21% | 25% | 53%
amzn-smt-eager-arithmetic/src0% | 0% | 3% | 20% | 75%
amzn-smt-ir-derive/src0% | 0% | 0% | 40% | 59%
amzn-smt-ir/benches0% | 0% | 0% | 62% | 37%
amzn-smt-ir/src0% | 0% | 0% | 0% | 100%
amzn-smt-string-fct-updater/src0% | 0% | 0% | 0% | 100%
amzn-smt-prediction/src0% | 0% | 0% | 0% | 100%
amzn-smt-string-transformer0% | 0% | 0% | 0% | 100%
amzn-smt-eager-arithmetic/benches0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
fn fix_repeated_string()
in amzn-smt-string-transformer/src/string_mappings.rs
94 22 7
fn adder()
in amzn-smt-eager-arithmetic/src/encoding.rs
42 13 3
def do_runtime_prediction()
in amzn-smt-prediction/scripts/generate_predictions.py
57 12 2
fn canonicalize_plus_inner()
in amzn-smt-eager-arithmetic/src/canonicalize.rs
103 9 1
def do_solver_configuration()
in amzn-smt-prediction/scripts/generate_predictions.py
14 9 3
fn add_keep_substring_prefix_suffixes()
in amzn-smt-string-transformer/src/transpiler.rs
43 9 1
fn get_string_subsets()
in amzn-smt-string-transformer/src/string_mappings.rs
36 9 2
fn determine_special_case()
in amzn-smt-eager-arithmetic/src/stats.rs
48 8 1
fn derive_operation()
in amzn-smt-ir-derive/src/lib.rs
100 8 1
fn initialize_charmap_with_ranges()
in amzn-smt-string-transformer/src/transpiler.rs
36 8 3
fn process_string_fct()
in amzn-smt-string-transformer/src/transpiler_visitors.rs
42 8 3
fn encode_plus()
in amzn-smt-eager-arithmetic/src/encoding.rs
28 7 3
def get_naive_big_encoding()
in amzn-smt-prediction/scripts/clean_eager_lazy_data.py
11 7 1
def do_eager_lazy()
in amzn-smt-prediction/scripts/generate_predictions.py
30 7 2
fn fold_assert()
in amzn-smt-string-transformer/src/subformula_parser.rs
32 7 2
fn propagate_through_relnodes()
in amzn-smt-string-transformer/src/callgraph.rs
55 7 5
fn construct_mapping()
in amzn-smt-string-transformer/src/transpiler.rs
40 7 2
fn is_contained_in()
in amzn-smt-string-transformer/src/string_mappings.rs
15 7 2
fn inspect_parameters()
in amzn-smt-string-transformer/src/transpiler_visitors.rs
32 7 4
fn fold_core_op()
in amzn-smt-eager-arithmetic/src/canonicalize.rs
56 6 2