facebookresearch / private_prediction
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 51 units with 942 lines of code in units (80.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (113 lines of code)
    • 13 medium size units (479 lines of code)
    • 14 small units (208 lines of code)
    • 22 very small units (142 lines of code)
0% | 11% | 50% | 22% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 11% | 50% | 22% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 11% | 50% | 22% | 15%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train_model()
in modeling.py
57 18 12
def backward()
in modules.py
56 2 2
def subsagg_method()
in private_prediction.py
49 13 4
def logit_sensitivity_method()
in private_prediction.py
49 14 4
def sensitivity_scale()
in private_prediction.py
45 21 7
def cross_validate()
in private_prediction_experiment.py
44 15 3
def main()
in private_prediction_experiment.py
44 18 1
def dpsgd_method()
in private_prediction.py
39 6 4
def loss_perturbation_method()
in private_prediction.py
38 6 4
def compute_accuracy()
in private_prediction.py
36 15 4
def model_sensitivity_method()
in private_prediction.py
33 5 4
def backward()
in modules.py
29 4 2
def pca()
in dataloading.py
26 7 3
26 10 4
def load_datasampler()
in dataloading.py
21 6 4
def main()
in install.py
20 7 0
def download()
in dataloading.py
18 4 1
def backward()
in modules.py
17 3 2
def privatize_model()
in modeling.py
16 8 3
def private_prediction()
in private_prediction.py
15 3 2