awslabs / rust-smt-ir
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 639 units with 6,382 lines of code in units (53.2% of code).
    • 2 very long units (214 lines of code)
    • 16 long units (1,087 lines of code)
    • 45 medium size units (1,482 lines of code)
    • 96 small units (1,353 lines of code)
    • 480 very small units (2,246 lines of code)
3% | 17% | 23% | 21% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs3% | 17% | 23% | 19% | 35%
py0% | 14% | 22% | 39% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
amzn-smt-ir/src3% | 7% | 5% | 21% | 61%
amzn-smt-eager-arithmetic/src9% | 9% | 38% | 25% | 17%
amzn-smt-ir-derive/src0% | 69% | 17% | 7% | 6%
amzn-smt-string-transformer/src0% | 22% | 46% | 21% | 9%
amzn-smt-string-fct-updater/src0% | 52% | 37% | 0% | 9%
amzn-smt-prediction/src0% | 43% | 44% | 0% | 11%
amzn-smt-prediction/scripts0% | 21% | 20% | 32% | 24%
amzn-smt-ir/benches0% | 0% | 62% | 25% | 11%
amzn-smt-string-transformer0% | 0% | 24% | 51% | 24%
amzn-smt-eager-arithmetic/benches0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn convert()
in amzn-smt-ir/src/term/convert.rs
111 5 1
fn canonicalize_plus_inner()
in amzn-smt-eager-arithmetic/src/canonicalize.rs
103 9 1
fn derive_operation()
in amzn-smt-ir-derive/src/lib.rs
100 8 1
fn fix_repeated_string()
in amzn-smt-string-transformer/src/string_mappings.rs
94 22 7
fn convert_z3escapes()
in amzn-smt-string-fct-updater/src/transpiler.rs
86 5 1
fn fold_core_op()
in amzn-smt-ir/src/cnf.rs
85 4 2
fn derive_fmt_any()
in amzn-smt-ir-derive/src/lib.rs
73 6 2
fn reconstruct_uninterpreted_funcs()
in amzn-smt-ir/src/ackerman.rs
71 4 5
fn derive_fold()
in amzn-smt-ir-derive/src/lib.rs
65 3 1
fn sort()
in amzn-smt-ir/src/logic/bitvecs.rs
63 3 2
fn main()
in amzn-smt-prediction/src/main.rs
62 3 0
fn derive_iterate()
in amzn-smt-ir-derive/src/lib.rs
58 5 1
def do_runtime_prediction()
in amzn-smt-prediction/scripts/generate_predictions.py
57 12 2
fn fold_core_op()
in amzn-smt-eager-arithmetic/src/canonicalize.rs
56 6 2
fn propagate_through_relnodes()
in amzn-smt-string-transformer/src/callgraph.rs
55 7 5
fn propagate_used_with()
in amzn-smt-string-transformer/src/callgraph.rs
55 5 3
fn convert()
in amzn-smt-string-transformer/src/main.rs
55 3 1
fn fold_theory_op()
in amzn-smt-eager-arithmetic/src/encoding.rs
52 5 2
fn bench_parse()
in amzn-smt-ir/benches/parsing.rs
49 6 3
fn determine_special_case()
in amzn-smt-eager-arithmetic/src/stats.rs
48 8 1