facebookresearch / LaMCTS
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 479 units with 5,292 lines of code in units (83.7% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (166 lines of code)
    • 6 medium complex units (257 lines of code)
    • 49 simple units (1,105 lines of code)
    • 422 very simple units (3,764 lines of code)
0% | 3% | 4% | 20% | 71%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 3% | 4% | 20% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
LaNAS/LaNet/CIFAR100% | 9% | 18% | 15% | 56%
LaNAS/Distributed_LaNAS/clientX0% | 10% | 7% | 25% | 56%
LA-MCTS/lamcts0% | 0% | 5% | 20% | 73%
LaNAS/Distributed_LaNAS/server0% | 0% | 0% | 37% | 62%
LaNAS/LaNAS_NASBench1010% | 0% | 0% | 29% | 70%
LaNAS/one-shot_LaNAS/LaNAS0% | 0% | 0% | 23% | 76%
LaNAS/one-shot_LaNAS/Evaluate0% | 0% | 0% | 16% | 83%
LaNAS/one-shot_LaNAS/supernet0% | 0% | 0% | 8% | 91%
LA-MCTS/functions0% | 0% | 0% | 19% | 80%
LA-MCTS-baselines/Nevergrad0% | 0% | 0% | 0% | 100%
LA-MCTS-baselines/Bayesian-Optimization0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
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 gen_all_nets()
in LaNAS/LaNet/CIFAR10/nasnet_set.py
28 17 1
def gen_all_nets()
in LaNAS/Distributed_LaNAS/clientX/nasnet_set.py
28 16 1
def main()
in LaNAS/LaNet/CIFAR10/train.py
103 16 0
def translator()
in LaNAS/Distributed_LaNAS/clientX/nasnet_set.py
32 14 2
def translator()
in LaNAS/LaNet/CIFAR10/nasnet_set.py
32 14 2
def propose_rand_samples_sobol()
in LA-MCTS/lamcts/Classifier.py
34 12 5
def get_node_depth()
in LaNAS/Distributed_LaNAS/clientX/nasnet_set.py
13 10 2
def forward()
in LaNAS/one-shot_LaNAS/Evaluate/individual_model.py
21 10 5
def get_node_depth()
in LaNAS/LaNet/CIFAR10/nasnet_set.py
13 10 2
def search()
in LaNAS/Distributed_LaNAS/server/MCTS.py
46 9 1
def train()
in LaNAS/Distributed_LaNAS/clientX/client.py
54 9 1
def zero_supernet_generator()
in LaNAS/one-shot_LaNAS/supernet/generator.py
17 9 3
def heuristic_Controller()
in LA-MCTS/functions/functions.py
20 9 3
def dispatch_and_retrieve_jobs()
in LaNAS/Distributed_LaNAS/server/MCTS.py
38 8 2
def gen_code()
in LaNAS/Distributed_LaNAS/clientX/nasnet_set.py
13 8 1
def split_and_output()
in LaNAS/Distributed_LaNAS/clientX/nasnet_set.py
17 8 3
def __init__()
in LaNAS/one-shot_LaNAS/LaNAS/MCTS.py
28 8 4
def zero_supernet_generator()
in LaNAS/one-shot_LaNAS/supernet/supernet_train.py
16 8 1