facebookresearch / Detectron
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 531 units with 7,786 lines of code in units (51.1% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (179 lines of code)
    • 27 medium complex units (1,553 lines of code)
    • 59 simple units (1,503 lines of code)
    • 443 very simple units (4,551 lines of code)
0% | 2% | 19% | 19% | 58%
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% | 2% | 20% | 18% | 58%
pyx0% | 0% | 0% | 51% | 48%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
detectron/utils0% | 6% | 10% | 23% | 59%
detectron/roi_data0% | 8% | 26% | 15% | 49%
detectron/modeling0% | 0% | 23% | 10% | 65%
detectron/core0% | 0% | 40% | 24% | 34%
tools0% | 0% | 17% | 25% | 56%
detectron/datasets0% | 0% | 17% | 17% | 65%
detectron/ops0% | 0% | 0% | 37% | 62%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def vis_one_image()
in detectron/utils/vis.py
117 31 14
def add_retinanet_blobs()
in detectron/roi_data/retinanet.py
62 28 5
def voc_eval()
in detectron/datasets/voc_eval.py
84 25 7
def add_fpn_retinanet_outputs()
in detectron/modeling/retinanet_heads.py
160 24 4
def _add_gt_annotations()
in detectron/datasets/json_dataset.py
74 20 2
57 19 3
def get_fast_rcnn_blob_names()
in detectron/roi_data/fast_rcnn.py
33 19 1
def add_rpn_blobs()
in detectron/roi_data/rpn.py
56 18 3
def im_detect_all()
in detectron/core/test.py
44 16 4
def im_detect_bbox_aug()
in detectron/core/test.py
72 16 3
def vis_keypoints()
in detectron/utils/vis.py
46 15 4
def vis_one_image_opencv()
in detectron/utils/vis.py
32 15 9
def check()
in detectron/utils/model_convert_utils.py
17 15 2
def convert_cityscapes_instance_only()
in tools/convert_cityscapes_to_coco.py
87 14 2
def _single_gpu_build_func()
in detectron/modeling/model_builder.py
44 14 1
def combine_heatmaps_size_dep()
in detectron/core/test.py
17 13 5
def print_net()
in detectron/utils/net.py
34 13 2
def add_fpn()
in detectron/modeling/FPN.py
106 13 2
def _get_rpn_blobs()
in detectron/roi_data/rpn.py
99 13 5
def add_fast_rcnn_blobs()
in detectron/roi_data/fast_rcnn.py
14 13 3