facebookresearch / FaderNetworks
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 57 units with 883 lines of code in units (72.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (54 lines of code)
    • 12 medium size units (371 lines of code)
    • 22 small units (326 lines of code)
    • 22 very small units (132 lines of code)
0% | 6% | 42% | 36% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 6% | 42% | 36% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 6% | 41% | 36% | 14%
data0% | 0% | 62% | 37% | 0%
ROOT0% | 0% | 0% | 52% | 47%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def evaluate()
in src/evaluation.py
54 9 2
def build_layers()
in src/model.py
47 11 11
def __init__()
in src/training.py
46 12 7
def get_optimizer()
in src/utils.py
40 13 2
def autoencoder_step()
in src/training.py
40 10 1
def preprocess_images()
in data/preprocess.py
30 10 0
def load_images()
in src/loader.py
30 6 1
def __init__()
in src/model.py
25 1 2
def reload_model()
in src/utils.py
24 8 3
def eval_clf_accuracy()
in src/evaluation.py
23 8 1
def __init__()
in src/model.py
23 4 2
def flip_attributes()
in src/model.py
22 4 4
def ptc_dis_step()
in src/training.py
21 2 1
def eval_clf_dis_accuracy()
in src/evaluation.py
20 6 1
def create_logger()
in src/logger.py
20 6 1
def __init__()
in src/model.py
20 1 2
def __init__()
in src/model.py
19 1 2
def preprocess_attributes()
in data/preprocess.py
18 7 0
def clip_grad_norm()
in src/utils.py
17 6 3
def decode()
in src/model.py
16 3 3