facebookresearch / LaMCTS
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 479 units with 5,292 lines of code in units (83.7% of code).
    • 1 very long units (103 lines of code)
    • 6 long units (432 lines of code)
    • 60 medium size units (1,627 lines of code)
    • 117 small units (1,690 lines of code)
    • 295 very small units (1,440 lines of code)
1% | 8% | 30% | 31% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py1% | 8% | 30% | 31% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
LaNAS/LaNet/CIFAR1011% | 9% | 21% | 39% | 18%
LaNAS/Distributed_LaNAS/clientX0% | 24% | 26% | 30% | 19%
LaNAS/one-shot_LaNAS/Evaluate0% | 14% | 24% | 31% | 29%
LaNAS/one-shot_LaNAS/supernet0% | 12% | 13% | 40% | 32%
LA-MCTS/lamcts0% | 0% | 44% | 20% | 35%
LaNAS/Distributed_LaNAS/server0% | 0% | 48% | 21% | 29%
LaNAS/LaNAS_NASBench1010% | 0% | 42% | 24% | 32%
LaNAS/one-shot_LaNAS/LaNAS0% | 0% | 35% | 31% | 33%
LA-MCTS/functions0% | 0% | 54% | 37% | 8%
LA-MCTS-baselines/Nevergrad0% | 0% | 0% | 60% | 39%
LA-MCTS-baselines/Bayesian-Optimization0% | 0% | 0% | 63% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in LaNAS/LaNet/CIFAR10/train.py
103 16 0
def run()
in LaNAS/one-shot_LaNAS/Evaluate/super_individual_train.py
86 5 0
def edit_distance()
in LaNAS/Distributed_LaNAS/clientX/nasnet_set.py
83 46 2
def edit_distance()
in LaNAS/LaNet/CIFAR10/nasnet_set.py
83 46 2
def __init__()
in LaNAS/one-shot_LaNAS/supernet/supernet_train.py
73 5 19
def train()
in LaNAS/Distributed_LaNAS/clientX/client.py
54 9 1
def run()
in LaNAS/Distributed_LaNAS/clientX/train_client.py
53 6 14
def search()
in LaNAS/Distributed_LaNAS/server/MCTS.py
46 9 1
def main()
in LaNAS/Distributed_LaNAS/clientX/continue_train.py
44 4 0
def __init__()
in LaNAS/Distributed_LaNAS/server/MCTS.py
40 6 4
def search()
in LaNAS/LaNAS_NASBench101/MCTS.py
39 7 1
def propose_rand_samples_probe()
in LA-MCTS/lamcts/Classifier.py
39 7 5
def dispatch_and_retrieve_jobs()
in LaNAS/Distributed_LaNAS/server/MCTS.py
38 8 2
def __init__()
in LaNAS/one-shot_LaNAS/Evaluate/individual_model.py
36 5 11
def plot_samples_and_boundary()
in LA-MCTS/lamcts/Classifier.py
35 5 3
def propose_rand_samples_sobol()
in LA-MCTS/lamcts/Classifier.py
34 12 5
def translator()
in LaNAS/Distributed_LaNAS/clientX/nasnet_set.py
32 14 2
def __init__()
in LaNAS/one-shot_LaNAS/supernet/supernet_model.py
32 3 11
def translator()
in LaNAS/LaNet/CIFAR10/nasnet_set.py
32 14 2
def __init__()
in LaNAS/LaNAS_NASBench101/MCTS.py
32 7 4