facebookresearch / ConvNeXt
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 111 units with 1,859 lines of code in units (46.7% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (404 lines of code)
    • 11 medium complex units (439 lines of code)
    • 11 simple units (316 lines of code)
    • 86 very simple units (700 lines of code)
0% | 21% | 23% | 16% | 37%
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% | 21% | 23% | 16% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 38% | 9% | 17% | 35%
object_detection/mmcv_custom0% | 0% | 77% | 0% | 22%
semantic_segmentation/mmcv_custom0% | 0% | 77% | 0% | 22%
object_detection/mmcv_custom/runner0% | 0% | 100% | 0% | 0%
semantic_segmentation/mmcv_custom/apex_runner0% | 0% | 100% | 0% | 0%
object_detection/mmdet/models0% | 0% | 0% | 46% | 53%
semantic_segmentation/backbone0% | 0% | 0% | 46% | 53%
models0% | 0% | 0% | 18% | 81%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def create_optimizer()
in optim_factory.py
77 38 6
def main()
in main.py
226 34 1
101 32 18
def _log_info()
in object_detection/mmcv_custom/customized_text.py
51 19 3
def _log_info()
in semantic_segmentation/mmcv_custom/customized_text.py
51 19 3
35 15 6
41 13 4
def get_num_layer_layer_wise()
in object_detection/mmcv_custom/layer_decay_optimizer_constructor.py
28 12 2
def save_checkpoint()
in object_detection/mmcv_custom/runner/checkpoint.py
45 12 4
def get_num_layer_layer_wise()
in semantic_segmentation/mmcv_custom/layer_decay_optimizer_constructor.py
28 12 2
def save_checkpoint()
in semantic_segmentation/mmcv_custom/apex_runner/checkpoint.py
45 12 4
def add_params()
in object_detection/mmcv_custom/layer_decay_optimizer_constructor.py
46 11 5
def add_params()
in semantic_segmentation/mmcv_custom/layer_decay_optimizer_constructor.py
46 11 5
23 11 1
def build_dataset()
in datasets.py
29 10 2
def build_transform()
in datasets.py
41 9 2
def get_parameter_groups()
in optim_factory.py
36 9 3
13 8 2
def log_every()
in utils.py
45 7 4
def __init__()
in object_detection/mmdet/models/backbones/convnext.py
33 7 16