facebookresearch / AttentiveNAS
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 244 units with 2,288 lines of code in units (72.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (283 lines of code)
    • 21 simple units (450 lines of code)
    • 217 very simple units (1,555 lines of code)
0% | 0% | 12% | 19% | 67%
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% | 0% | 12% | 19% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
models0% | 0% | 20% | 28% | 50%
ROOT0% | 0% | 58% | 0% | 41%
utils0% | 0% | 19% | 21% | 59%
data0% | 0% | 9% | 15% | 74%
models/modules0% | 0% | 3% | 9% | 87%
solver0% | 0% | 0% | 52% | 47%
sampler0% | 0% | 0% | 53% | 46%
evaluate0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in data/auto_augment_tf.py
31 21 5
def get_parameters()
in models/modules/nn_base.py
27 17 4
def __init__()
in models/attentive_nas_dynamic_model.py
88 14 5
def main_worker()
in train_attentive_nas.py
70 12 3
def load_checkpoints()
in utils/saver.py
25 11 5
def profile()
in utils/flops_counter.py
42 11 5
def compute_active_subnet_flops()
in models/attentive_nas_dynamic_model.py
46 10 1
def init_model()
in models/modules/nn_base.py
21 10 2
def mutate_and_reset()
in models/attentive_nas_dynamic_model.py
15 9 4
def build_activation()
in models/modules/nn_utils.py
19 9 2
def build_lr_scheduler()
in solver/build.py
51 9 2
def __repr__()
in utils/config.py
21 8 1
def crossover_and_reset()
in models/attentive_nas_dynamic_model.py
17 8 4
def forward()
in models/modules/static_layers.py
13 8 2
def sample_archs_according_to_flops()
in sampler/attentive_nas_sampler.py
21 8 6
def setup_logging()
in utils/logging.py
23 7 2
def build_trasition_prob_matrix()
in sampler/attentive_nas_sampler.py
22 7 2
def __init__()
in utils/config.py
12 6 3
def yaml()
in utils/config.py
17 6 1
def forward()
in models/attentive_nas_dynamic_model.py
16 6 2