facebookresearch / Private-ID
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 230 units with 3,353 lines of code in units (29.6% of code).
    • 1 very long units (115 lines of code)
    • 4 long units (253 lines of code)
    • 42 medium size units (1,311 lines of code)
    • 69 small units (998 lines of code)
    • 114 very small units (676 lines of code)
3% | 7% | 39% | 29% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rs3% | 7% | 39% | 29% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
protocol/src5% | 6% | 48% | 30% | 9%
common/datagen0% | 84% | 0% | 0% | 15%
crypto/src0% | 9% | 20% | 19% | 50%
crypto/benches0% | 0% | 58% | 25% | 16%
common/src0% | 0% | 0% | 63% | 36%
protocol-rpc/src0% | 0% | 0% | 40% | 59%
protocol-rpc0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn calculate_set_diff()
in protocol/src/private_id_multi_key/company.rs
115 8 1
fn calculate_suids()
in protocol/src/suid_create/merger.rs
71 8 1
fn shuffle_flatten()
in protocol/src/suid_create/sharer.rs
68 3 3
fn main()
in common/datagen/datagen.rs
59 1 0
fn extended_binary_gcd()
in crypto/src/gcd.rs
55 10 2
fn reveal>()
in protocol/src/cross_psi/partner.rs
50 3 2
fn parallel_additive_shares()
in crypto/benches/paillier_benchmark.rs
45 2 2
fn encrypt_permute()
in protocol/src/private_id_multi_key/partner.rs
43 1 3
fn create_id_map()
in protocol/src/private_id/partner.rs
42 4 4
fn get_party_merger_keys()
in protocol/src/suid_create/merger.rs
42 1 1
fn get_set_diff_output()
in protocol/src/private_id_multi_key/company.rs
41 1 2
fn reveal>()
in protocol/src/cross_psi/company.rs
40 3 2
fn unshuffle_suids()
in protocol/src/suid_create/sharer.rs
38 1 2
fn calculate_intersection()
in protocol/src/cross_psi_xor/company.rs
37 4 2
fn calculate_intersection()
in protocol/src/cross_psi/company.rs
36 5 2
fn miller_rabin()
in crypto/src/prime.rs
35 7 2
fn write_company_to_id_map()
in protocol/src/private_id_multi_key/company.rs
35 3 1
fn gen_decryption_key()
in crypto/src/paillier.rs
34 1 1
fn calculate_set_diff()
in protocol/src/private_id/company.rs
34 1 1
fn set_encrypted_company()
in protocol/src/private_id_multi_key/company.rs
34 1 4