facebookresearch / recipes
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 219 units with 1,375 lines of code in units (36.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 4 simple units (54 lines of code)
    • 215 very simple units (1,321 lines of code)
0% | 0% | 0% | 3% | 96%
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% | 0% | 3% | 96%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
torchrecipes/audio/source_separation0% | 0% | 0% | 10% | 89%
torchrecipes/utils0% | 0% | 0% | 11% | 88%
torchrecipes/vision/data0% | 0% | 0% | 5% | 94%
torchrecipes/vision/image_generation0% | 0% | 0% | 2% | 97%
torchrecipes/vision/image_classification0% | 0% | 0% | 0% | 100%
torchrecipes/text/doc_classification0% | 0% | 0% | 0% | 100%
torchrecipes/core0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
torchrecipes/vision/core0% | 0% | 0% | 0% | 100%
torchrecipes/launcher0% | 0% | 0% | 0% | 100%
torchrecipes0% | 0% | 0% | 0% | 100%
torchrecipes/checkpointing0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def setup()
in torchrecipes/audio/source_separation/datamodule/librimix.py
27 8 2
def get_trainer_params()
in torchrecipes/utils/trainer_plugins.py
11 6 1
def weights_init_normal()
in torchrecipes/vision/image_generation/module/infogan.py
7 6 1
def __validate_init_configuration()
in torchrecipes/vision/data/modules/mnist_data_module.py
9 6 1
def get_class_config_method()
in torchrecipes/utils/config_utils.py
13 5 1
def setup()
in torchrecipes/vision/data/modules/mnist_data_module.py
14 5 2
def setup()
in torchrecipes/vision/data/modules/torchvision_data_module.py
12 5 2
def main()
in torchrecipes/launcher/run.py
8 4 0
def train()
in torchrecipes/core/base_train_app.py
25 4 1
def __call__()
in torchrecipes/audio/source_separation/datamodule/utils.py
14 4 2
def run()
in setup.py
10 4 1
def get_default_model_checkpoint()
in torchrecipes/core/base_train_app.py
12 3 1
def find_last_checkpoint_path()
in torchrecipes/utils/checkpoint.py
11 3 1
def _get_lambda()
in torchrecipes/utils/mixup_utils.py
6 3 1
def get_rank()
in torchrecipes/utils/distributed_utils.py
4 3 0
def get_world_size()
in torchrecipes/utils/distributed_utils.py
4 3 0
def barrier()
in torchrecipes/utils/distributed_utils.py
4 3 0
def on_epoch_end()
in torchrecipes/vision/image_generation/callbacks/image_generation.py
24 3 3
def _weights_init()
in torchrecipes/vision/image_generation/module/gan.py
7 3 1
def discriminator_step()
in torchrecipes/vision/image_generation/module/infogan.py
8 3 1