facebookresearch / Addressing-the-Topological-Defects-of-Disentanglement
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 229 units with 2,522 lines of code in units (74.7% of code).
    • 1 very long units (194 lines of code)
    • 2 long units (107 lines of code)
    • 18 medium size units (562 lines of code)
    • 59 small units (864 lines of code)
    • 149 very small units (795 lines of code)
7% | 4% | 22% | 34% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 4% | 22% | 34% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
complex_shift_operator100% | 0% | 0% | 0% | 0%
ROOT0% | 5% | 21% | 41% | 31%
datasets0% | 0% | 32% | 20% | 46%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in complex_shift_operator/__main__.py
194 32 1
def init_argparse()
in run_experiments_real.py
56 1 0
def train()
in cci_variational_autoencoder.py
51 8 4
def reconstruction_mse_transformed_z1_weak()
in weakly_complex_shift_autoencoder.py
41 2 5
def train()
in complex_shift_autoencoder.py
40 4 5
39 7 7
def train()
in weakly_complex_shift_autoencoder.py
39 4 5
def __init__()
in models.py
34 1 5
34 4 3
def download_mnist()
in datasets/datasets.py
33 1 1
def download_mnist()
in datasets/datasets.py
33 1 1
def train()
in autoencoder.py
33 6 4
def generate_angles()
in datasets/data_utils.py
31 1 3
def train_autoencoder()
in run_experiments_real.py
29 1 7
def get_experiment_function()
in run_experiments_real.py
29 5 1
def draw_line()
in datasets/xiaolinwu.py
28 4 4
def generate_images_from_coords()
in datasets/data_utils.py
27 7 4
def load_data()
in autoencoder.py
25 4 2
def load_data()
in cci_variational_autoencoder.py
25 4 2
def save_plots()
in autoencoder.py
21 5 2