facebookresearch / grounding-inductive-biases
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 472 units with 4,062 lines of code in units (62.2% of code).
    • 2 very long units (482 lines of code)
    • 2 long units (148 lines of code)
    • 26 medium size units (844 lines of code)
    • 61 small units (816 lines of code)
    • 381 very small units (1,772 lines of code)
11% | 3% | 20% | 20% | 43%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 3% | 20% | 20% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
data_utils73% | 0% | 18% | 0% | 7%
data_augmentation27% | 14% | 43% | 6% | 8%
image_similarity0% | 24% | 0% | 0% | 75%
augerino_lib0% | 0% | 26% | 39% | 33%
auto_augment0% | 0% | 33% | 14% | 51%
similarity_search_experiments0% | 0% | 25% | 23% | 51%
experiment_utils0% | 0% | 59% | 16% | 23%
utils0% | 0% | 19% | 34% | 45%
models0% | 0% | 34% | 40% | 25%
per_class_augmentation0% | 0% | 5% | 30% | 63%
foreground_variation0% | 0% | 11% | 16% | 72%
equivariance_measure0% | 0% | 3% | 24% | 71%
wordnet_analysis0% | 0% | 0% | 19% | 80%
minimal_checkpoint_example0% | 0% | 0% | 50% | 50%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def return_loader_and_sampler()
in data_utils/functions.py
305 27 4
def main_worker()
in data_augmentation/my_training.py
177 33 5
def main_worker()
in data_augmentation/test.py
92 15 4
def main()
in image_similarity/sanity_checks.py
56 2 1
def test()
in data_augmentation/test.py
49 14 6
def train()
in data_augmentation/my_training.py
49 11 6
def validate()
in data_augmentation/my_training.py
48 16 4
def experiment()
in data_augmentation/hydra_test_local.py
47 7 1
def create_generators()
in augerino_lib/uniform_aug.py
44 7 2
def return_augmentations_types()
in data_utils/functions_bis.py
42 3 1
def create_new_experiment()
in experiment_utils/experiment_repo.py
42 7 5
def experiment()
in data_augmentation/hydra_app_local.py
40 7 1
def return_loader_and_sampler()
in data_utils/functions_bis.py
37 5 4
def restart_from_checkpoint()
in utils/checkpointing.py
35 18 4
def generate()
in augerino_lib/uniform_aug.py
33 3 2
def _make_layer()
in models/arch.py
32 7 8
def _create_dataloader()
in per_class_augmentation/data.py
28 2 3
def create_repo()
in data_augmentation/my_training.py
28 7 2
def __init__()
in auto_augment/best_policies.py
28 1 4
def __init__()
in auto_augment/best_policies.py
28 1 4