facebookresearch / deepmeg-recurrent-encoder
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 71 units with 1,967 lines of code in units (92.6% of code).
    • 4 very long units (500 lines of code)
    • 7 long units (468 lines of code)
    • 21 medium size units (659 lines of code)
    • 14 small units (207 lines of code)
    • 25 very small units (133 lines of code)
25% | 23% | 33% | 10% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py25% | 23% | 33% | 10% | 6%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
neural31% | 17% | 31% | 11% | 7%
neural/linear14% | 34% | 37% | 8% | 5%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def load_torch_megs()
in neural/dataset.py
133 38 6
def main()
in neural/__main__.py
132 20 0
def extract_subject()
in neural/extraction.py
127 17 1
def eval_lin_models()
in neural/linear/__main__.py
108 18 9
def train_eval_model()
in neural/train.py
84 18 10
def report_correl()
in neural/visuals.py
81 5 5
def report_correl()
in neural/linear/stats.py
74 3 4
def predict()
in neural/linear/lin_model_template.py
64 24 5
def report_correl_all()
in neural/linear/stats.py
57 5 4
def __init__()
in neural/model.py
55 8 13
def fit()
in neural/linear/arx.py
53 17 3
def plot_weights()
in neural/linear/lin_model_template.py
48 11 3
def main()
in neural/linear/__main__.py
47 16 0
def _clean_log()
in neural/utils_mous.py
46 4 1
def _add_stim_id()
in neural/utils_mous.py
40 9 3
def plot_score_per_time_topo()
in neural/visuals.py
40 4 7
def get_parser()
in neural/__main__.py
40 1 0
def get_log_times()
in neural/utils_mous.py
39 3 3
def plot_weights()
in neural/linear/receptive_field.py
32 7 3
def formulate_regression()
in neural/linear/lin_model_template.py
32 7 3