apple / ml-cvnets
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 667 units with 8,354 lines of code in units (76.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (124 lines of code)
    • 23 medium complex units (1,052 lines of code)
    • 64 simple units (1,936 lines of code)
    • 579 very simple units (5,242 lines of code)
0% | 1% | 12% | 23% | 62%
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% | 1% | 12% | 23% | 62%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
engine0% | 12% | 29% | 35% | 22%
cvnets0% | 0% | 10% | 20% | 69%
ROOT0% | 0% | 60% | 6% | 32%
data0% | 0% | 5% | 19% | 74%
utils0% | 0% | 19% | 42% | 38%
options0% | 0% | 22% | 0% | 77%
loss_fn0% | 0% | 0% | 24% | 75%
optim0% | 0% | 0% | 28% | 71%
metrics0% | 0% | 0% | 33% | 66%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run()
in engine/training_engine.py
124 36 2
def predict_and_save()
in engine/eval_segmentation.py
80 23 8
def _init_nn_layers()
in cvnets/misc/init_utils.py
39 22 3
def main()
in main_train.py
91 21 2
def __call__()
in data/transforms/image.py
43 18 2
def main_detection_evaluation()
in engine/eval_detection.py
46 18 1
def main_segmentation_evaluation()
in engine/eval_segmentation.py
38 17 1
def parameter_list()
in cvnets/misc/common.py
20 16 3
def additional_transforms()
in data/datasets/dataset_base.py
36 16 1
def train_epoch()
in engine/training_engine.py
60 16 2
def __init__()
in cvnets/layers/conv_layer.py
53 14 14
def __init__()
in cvnets/models/detection/ssd.py
80 14 3
def predict_and_save()
in engine/eval_detection.py
60 14 5
def __init__()
in cvnets/layers/conv_layer.py
53 13 14
def load_config_file()
in options/utils.py
32 13 1
def get_normalization_layer()
in cvnets/layers/normalization_layers.py
28 12 5
def main_worker()
in main_train.py
53 12 1
def load_checkpoint()
in utils/checkpoint_utils.py
36 12 6
def build_classification_model()
in cvnets/models/classification/__init__.py
39 11 3
def build_segmentation_model()
in cvnets/models/segmentation/__init__.py
45 11 1