facebookresearch / MaskFormer
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 145 units with 2,121 lines of code in units (28.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (76 lines of code)
    • 8 medium complex units (410 lines of code)
    • 11 simple units (294 lines of code)
    • 125 very simple units (1,341 lines of code)
0% | 3% | 19% | 13% | 63%
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% | 19% | 13% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools0% | 30% | 32% | 12% | 24%
mask_former/data0% | 0% | 45% | 13% | 40%
ROOT0% | 0% | 41% | 27% | 31%
mask_former0% | 0% | 21% | 20% | 58%
mask_former/modeling0% | 0% | 2% | 8% | 89%
mask_former/utils0% | 0% | 0% | 56% | 43%
datasets0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def pq_compute_single_image()
in tools/evaluate_pq_for_semantic_segmentation.py
76 29 4
def build_optimizer()
in train_net.py
68 17 3
def __call__()
in mask_former/data/dataset_mappers/mask_former_panoptic_dataset_mapper.py
73 16 2
def get_metadata()
in mask_former/data/datasets/register_ade20k_panoptic.py
19 15 0
def __call__()
in mask_former/data/dataset_mappers/mask_former_semantic_dataset_mapper.py
57 14 2
def main()
in tools/evaluate_pq_for_semantic_segmentation.py
83 13 0
def forward()
in mask_former/mask_former_model.py
46 13 2
def forward()
in mask_former/modeling/criterion.py
21 12 3
def __call__()
in mask_former/data/dataset_mappers/detr_panoptic_dataset_mapper.py
43 11 2
def build_evaluator()
in train_net.py
45 10 4
def _freeze_stages()
in mask_former/modeling/backbone/swin.py
14 8 1
def load_ade20k_panoptic_json()
in mask_former/data/datasets/register_ade20k_panoptic.py
36 8 5
def panoptic_inference()
in mask_former/mask_former_model.py
44 8 3
def do_flop()
in tools/analyze_model.py
31 7 1
def nested_tensor_from_tensor_list()
in mask_former/utils/misc.py
17 7 1
def forward()
in mask_former/modeling/backbone/swin.py
39 7 4
def _get_ade20k_full_meta()
in mask_former/data/datasets/register_ade20k_full.py
10 7 0
def _get_coco_stuff_meta()
in mask_former/data/datasets/register_coco_stuff_10k.py
10 7 0
def _onnx_nested_tensor_from_tensor_list()
in mask_former/utils/misc.py
20 6 1
def memory_efficient_forward()
in mask_former/modeling/matcher.py
28 6 3