facebookresearch / privacy_lint
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 36 units with 222 lines of code in units (53.8% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 5 small units (65 lines of code)
    • 31 very small units (157 lines of code)
0% | 0% | 0% | 29% | 70%
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% | 0% | 29% | 70%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
privacy_lint0% | 0% | 0% | 40% | 59%
privacy_lint/dataset0% | 0% | 0% | 50% | 50%
privacy_lint/attacks0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def group()
in privacy_lint/attack_results.py
16 3 3
def __init__()
in privacy_lint/dataset/__init__.py
14 3 3
def flatten()
in privacy_lint/dataset/masks.py
13 5 2
def balance()
in privacy_lint/attack_results.py
11 2 1
def get_max_accuracy_threshold()
in privacy_lint/attack_results.py
11 1 1
def generate_splits()
in privacy_lint/dataset/masks.py
10 2 2
def default_compute_accuracies()
in privacy_lint/attacks/gap.py
10 3 2
def compute_softmax()
in privacy_lint/attacks/shadow.py
10 3 2
def _get_scores_and_labels_ordered()
in privacy_lint/attack_results.py
9 1 1
def get_tpr_fpr()
in privacy_lint/attack_results.py
9 1 1
def train_attack_models()
in privacy_lint/attacks/shadow.py
9 2 1
def multiply_round()
in privacy_lint/dataset/masks.py
7 2 2
def _upsample()
in privacy_lint/attack_results.py
6 1 2
def get_accuracy()
in privacy_lint/attack_results.py
6 1 2
def get_precision_recall()
in privacy_lint/attack_results.py
6 1 1
def get_auc()
in privacy_lint/attack_results.py
6 1 1
def _get_area_under_curve()
in privacy_lint/attack_results.py
5 1 2
def __init__()
in privacy_lint/attacks/grad_norm.py
5 1 0
def launch()
in privacy_lint/attacks/grad_norm.py
5 1 0
def __init__()
in privacy_lint/attacks/loss.py
5 1 0