amazon-research / relaxed-adaptive-projection
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 90 units with 650 lines of code in units (44.4% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (78 lines of code)
    • 21 small units (310 lines of code)
    • 66 very small units (262 lines of code)
0% | 0% | 12% | 47% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 12% | 47% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
datasets0% | 0% | 31% | 41% | 26%
ROOT0% | 0% | 0% | 70% | 29%
relaxed_adaptive_projection0% | 0% | 0% | 60% | 39%
privacy_budget_tracking0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_queries()
in datasets/loans.py
26 13 3
def get_queries()
in datasets/toy_binary.py
26 13 3
def get_queries()
in datasets/adult.py
26 13 3
def preserve_statistic()
in statistickway_threshold.py
20 5 1
def __init__()
in relaxed_adaptive_projection/rap.py
19 3 3
def __log_progress()
in relaxed_adaptive_projection/rap.py
19 2 2
def __initialize_synthetic_dataset()
in relaxed_adaptive_projection/rap.py
19 5 2
def preserve_statistic()
in statistickway.py
18 6 1
def GDP_to_DP()
in utils_data.py
18 5 2
def DP_to_GDP()
in utils_data.py
18 5 2
def jit_loss_fn()
in utils_data.py
18 4 3
def numeric_sparse()
in utils_data.py
17 5 7
def preserve_subset_statistic()
in statistickway_threshold.py
16 3 1
def init_D_prime()
in utils_data.py
13 4 5
13 3 4
def project_feats()
in datasets/loans.py
12 6 2
def project_feats()
in datasets/toy_binary.py
12 6 2
def project_feats()
in datasets/adult.py
12 6 2
def get_dataset()
in datasets/loans.py
11 4 1
def randomKway()
in datasets/loans.py
11 5 4