amazon-research / minimax-fair
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 49 units with 1,265 lines of code in units (74.3% of code).
    • 4 very long units (688 lines of code)
    • 3 long units (181 lines of code)
    • 1 medium size units (42 lines of code)
    • 13 small units (182 lines of code)
    • 28 very small units (172 lines of code)
54% | 14% | 3% | 14% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py54% | 14% | 3% | 14% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src49% | 15% | 3% | 15% | 14%
ROOT100% | 0% | 0% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def do_learning()
in src/minmaxML.py
338 55 14
def do_pareto_plot()
in src/plot_relaxed_pareto.py
127 34 20
def get_dataset_features()
in dataset_mapping.py
114 17 1
def do_plotting()
in src/plotting.py
109 38 19
def setup_matrices()
in src/setup_matrices.py
73 37 11
def generate_synthetic_data()
in src/generate_matrices.py
55 20 17
53 4 9
def create_validation_split()
in src/train_test_split.py
42 11 5
def compute_model_errors()
in src/minmaxML.py
20 14 8
def determine_pareto_curve()
in src/hull_to_pareto.py
19 8 1
def write_params_to_s3()
in src/write_params_to_file.py
17 1 5
def save_dataset()
in src/save_dataset.py
16 7 8
def generate_random_intervals()
in src/generate_matrices.py
14 7 4
14 4 3
13 3 7
def fit()
in src/torch_wrapper.py
12 3 6
def get_pareto()
in src/plot_relaxed_pareto.py
12 3 2
def read_dataset_from_file()
in src/read_file.py
12 2 1
def generate_feature_matrix()
in src/generate_matrices.py
11 14 7
def create_bonus_plots()
in src/minmaxML.py
11 3 6