facebookresearch / GraphLog
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 337 units with 3,990 lines of code in units (71.4% of code).
    • 2 very long units (216 lines of code)
    • 12 long units (780 lines of code)
    • 32 medium size units (1,040 lines of code)
    • 54 small units (753 lines of code)
    • 237 very small units (1,201 lines of code)
5% | 19% | 26% | 18% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 19% | 26% | 18% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
experiments/codes/model14% | 13% | 30% | 16% | 25%
experiments/codes/experiment0% | 34% | 35% | 19% | 9%
experiments/codes/utils0% | 17% | 16% | 18% | 47%
graphlog0% | 15% | 9% | 29% | 44%
experiments/scripts0% | 42% | 35% | 21% | 0%
experiments/codes/logbook0% | 0% | 21% | 12% | 66%
experiments/codes/testtube0% | 0% | 32% | 0% | 67%
ROOT0% | 0% | 0% | 0% | 100%
experiments/codes/app0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in experiments/codes/model/gat/sig_edge_gat.py
110 11 3
def __init__()
in experiments/codes/model/gat/edge_gat.py
106 8 3
def adapt()
in experiments/codes/experiment/inference.py
87 22 7
def load_data_pyg()
in experiments/codes/utils/data.py
81 32 2
def __init__()
in experiments/codes/model/gat/edge_gat.py
77 7 3
def load_data()
in graphlog/dataset.py
76 17 2
def __init__()
in experiments/codes/model/gat/sig_edge_gat.py
71 10 3
def run_sequential_multitask_unique_composition()
in experiments/codes/experiment/checkpointable_multitask_experiment.py
59 11 1
def run_sequential_multitask_unique_representation()
in experiments/codes/experiment/checkpointable_multitask_experiment.py
59 11 1
def run_multitask_training_unique_composition()
in experiments/codes/experiment/checkpointable_multitask_experiment.py
56 10 1
def run_multitask_training_unique_representation()
in experiments/codes/experiment/checkpointable_multitask_experiment.py
55 10 1
def eval_continual_comp()
in experiments/scripts/eval_supervised.py
54 8 3
def __init__()
in experiments/codes/model/rgcn/rgcn.py
54 4 2
def load_data_dgl()
in experiments/codes/utils/data.py
51 15 2
def eval_continual()
in experiments/scripts/eval_supervised.py
46 5 3
def run_sequential_multitask_training()
in experiments/codes/experiment/checkpointable_multitask_experiment.py
46 11 1
def train()
in experiments/codes/experiment/checkpointable_multitask_experiment.py
45 8 6
def evaluate_representations()
in experiments/codes/experiment/inference.py
45 6 4
def run()
in experiments/codes/experiment/checkpointable_multitask_experiment.py
44 18 1
def forward()
in experiments/codes/model/gat/sig_edge_gat.py
43 12 2