facebookresearch / Cupcake
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 165 units with 1,289 lines of code in units (60.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (119 lines of code)
    • 34 small units (426 lines of code)
    • 126 very small units (744 lines of code)
0% | 0% | 9% | 33% | 57%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs0% | 0% | 9% | 33% | 57%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 13% | 34% | 52%
src/integer_arith0% | 0% | 6% | 19% | 73%
benches0% | 0% | 0% | 62% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn _barret_reduce()
in src/integer_arith/scalar.rs
28 5 2
fn multiply()
in src/rqpoly.rs
24 4 2
fn lazy_inverse_ntt()
in src/rqpoly.rs
23 3 1
fn compute_roots()
in src/rqpoly.rs
22 4 1
fn lazy_ntt()
in src/rqpoly.rs
22 3 1
fn decrypt()
in src/lib.rs
19 1 3
fn add_mod()
in src/integer_arith/mod.rs
15 1 3
fn from_vec()
in src/rqpoly.rs
15 2 2
fn bench_lazy_butterfly()
in benches/butterfly.rs
14 2 1
14 1 0
fn test_bit_reverse()
in src/utils.rs
14 1 0
14 1 0
fn homomorphic_addition()
in benches/scheme.rs
13 3 1
fn pow_mod()
in src/integer_arith/scalar.rs
13 3 3
fn test_barret_reduction()
in src/integer_arith/scalar.rs
13 1 0
fn encrypt_zero()
in src/lib.rs
13 2 2
13 1 0
fn multiply_fast()
in src/rqpoly.rs
13 3 2
fn coeffwise_multiply()
in src/rqpoly.rs
13 2 2
fn bench_butterfly()
in benches/butterfly.rs
12 2 1