facebookresearch / maskrcnn-benchmark
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 580 units with 7,320 lines of code in units (47.6% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (265 lines of code)
    • 16 medium complex units (686 lines of code)
    • 46 simple units (1,156 lines of code)
    • 515 very simple units (5,213 lines of code)
0% | 3% | 9% | 15% | 71%
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% | 8% | 15% | 71%
cpp0% | 0% | 32% | 50% | 16%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
maskrcnn_benchmark/data0% | 15% | 17% | 23% | 44%
maskrcnn_benchmark/utils0% | 7% | 11% | 27% | 53%
tools/cityscapes0% | 0% | 63% | 17% | 18%
maskrcnn_benchmark/csrc0% | 0% | 13% | 21% | 64%
maskrcnn_benchmark/structures0% | 0% | 10% | 17% | 72%
maskrcnn_benchmark/modeling0% | 0% | 1% | 11% | 86%
maskrcnn_benchmark/engine0% | 0% | 28% | 14% | 57%
tools0% | 0% | 0% | 23% | 76%
maskrcnn_benchmark/layers0% | 0% | 0% | 2% | 97%
maskrcnn_benchmark/config0% | 0% | 0% | 0% | 100%
maskrcnn_benchmark/solver0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def evaluateBoxMatches()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
112 45 2
def evaluateMaskMatches()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
114 45 2
def _rename_basic_resnet_weights()
in maskrcnn_benchmark/utils/c2_model_loading.py
39 36 1
def _prepare_batches()
in maskrcnn_benchmark/data/samplers/grouped_batch_sampler.py
26 22 1
def _rename_weights_for_resnet()
in maskrcnn_benchmark/utils/c2_model_loading.py
27 21 2
def preparePredImage()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
49 18 3
def make_data_loader()
in maskrcnn_benchmark/data/build.py
63 17 5
def convert_cityscapes_instance_only()
in tools/cityscapes/convert_cityscapes_to_coco.py
91 14 2
def __init__()
in maskrcnn_benchmark/structures/segmentation_mask.py
49 14 3
def to_image_list()
in maskrcnn_benchmark/structures/image_list.py
28 14 2
def forward()
in maskrcnn_benchmark/modeling/roi_heads/roi_heads.py
23 14 4
def __getitem__()
in maskrcnn_benchmark/data/datasets/coco.py
22 13 2
def im_detect_bbox_aug()
in maskrcnn_benchmark/engine/bbox_aug.py
42 13 3
def align_and_update_state_dicts()
in maskrcnn_benchmark/utils/model_serialization.py
30 12 2
def calc_detection_voc_prec_rec()
in maskrcnn_benchmark/data/datasets/evaluation/voc/voc_eval.py
66 12 3
def instances2dict_with_polygons()
in tools/cityscapes/instances2dict_with_polygons.py
34 11 2
void pre_calc_for_bilinear_interpolate()
in maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp
83 11 13
def select_over_all_levels()
in maskrcnn_benchmark/modeling/rpn/inference.py
23 11 2
def matchGtWithPred()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
30 11 3
void ROIAlignForward_cpu_kernel()
in maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp
78 10 11