facebookresearch / Mask2Former
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 360 units with 5,486 lines of code in units (39.8% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (355 lines of code)
    • 25 medium complex units (1,111 lines of code)
    • 33 simple units (907 lines of code)
    • 297 very simple units (3,113 lines of code)
0% | 6% | 20% | 16% | 56%
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% | 6% | 20% | 16% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mask2former_video/data_video0% | 22% | 35% | 16% | 25%
tools0% | 27% | 30% | 11% | 31%
mask2former/data0% | 0% | 34% | 27% | 38%
ROOT0% | 0% | 57% | 16% | 25%
mask2former0% | 0% | 19% | 58% | 22%
mask2former/evaluation0% | 0% | 100% | 0% | 0%
mask2former/modeling0% | 0% | 1% | 8% | 89%
mask2former_video/modeling0% | 0% | 4% | 0% | 95%
mask2former/utils0% | 0% | 0% | 56% | 43%
mask2former_video0% | 0% | 0% | 22% | 77%
mask2former_video/utils0% | 0% | 0% | 75% | 25%
demo_video0% | 0% | 0% | 7% | 92%
datasets0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def evaluateVid()
in mask2former_video/data_video/datasets/ytvis_api/ytvoseval.py
66 46 5
def accumulate()
in mask2former_video/data_video/datasets/ytvis_api/ytvoseval.py
90 35 2
def pq_compute_single_image()
in tools/evaluate_pq_for_semantic_segmentation.py
76 29 4
def computeIoU()
in mask2former_video/data_video/datasets/ytvis_api/ytvoseval.py
42 29 3
def load_ytvis_json()
in mask2former_video/data_video/datasets/ytvis.py
81 28 4
def build_evaluator()
in train_net.py
65 24 4
def _prepare()
in mask2former_video/data_video/datasets/ytvis_api/ytvoseval.py
39 19 1
def __call__()
in mask2former_video/data_video/dataset_mapper.py
65 19 2
def getAnnIds()
in mask2former_video/data_video/datasets/ytvis_api/ytvos.py
18 18 5
def get_metadata()
in mask2former/data/datasets/register_coco_panoptic_annos_semseg.py
19 17 0
def get_metadata()
in mask2former/data/datasets/register_ade20k_panoptic.py
19 17 0
def build_optimizer()
in train_net_video.py
68 17 3
def build_optimizer()
in train_net.py
68 17 3
def loadRes()
in mask2former_video/data_video/datasets/ytvis_api/ytvos.py
41 17 2
def __call__()
in mask2former/data/dataset_mappers/mask_former_panoptic_dataset_mapper.py
73 16 2
def __call__()
in mask2former/data/dataset_mappers/mask_former_instance_dataset_mapper.py
62 16 2
def summarize()
in mask2former_video/data_video/datasets/ytvis_api/ytvoseval.py
68 16 1
def forward()
in mask2former/maskformer_model.py
53 15 2
def get_metadata()
in mask2former/data/datasets/register_mapillary_vistas_panoptic.py
19 15 0
def computeOks()
in mask2former_video/data_video/datasets/ytvis_api/ytvoseval.py
36 15 3