facebookresearch / Detic
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 213 units with 4,162 lines of code in units (54.9% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (424 lines of code)
    • 16 medium complex units (939 lines of code)
    • 30 simple units (951 lines of code)
    • 162 very simple units (1,848 lines of code)
0% | 10% | 22% | 22% | 44%
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% | 10% | 22% | 22% | 44%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
detic/modeling/roi_heads0% | 20% | 8% | 21% | 49%
detic/modeling0% | 32% | 20% | 21% | 24%
detic/evaluation0% | 14% | 49% | 22% | 13%
detic/modeling/meta_arch0% | 17% | 0% | 25% | 57%
detic/data/datasets0% | 0% | 68% | 7% | 23%
ROOT0% | 0% | 53% | 0% | 46%
detic0% | 0% | 33% | 32% | 34%
detic/data0% | 0% | 16% | 42% | 41%
detic/modeling/backbone0% | 0% | 13% | 16% | 70%
tools0% | 0% | 0% | 55% | 44%
detic/modeling/text0% | 0% | 0% | 12% | 88%
detic/data/transforms0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def debug_second_stage()
in detic/modeling/debug.py
111 28 9
def forward()
in detic/modeling/meta_arch/custom_rcnn.py
69 28 3
def evaluate_img_google()
in detic/evaluation/oideval.py
83 28 4
def _forward_box()
in detic/modeling/roi_heads/detic_roi_heads.py
71 27 8
def image_label_losses()
in detic/modeling/roi_heads/detic_fast_rcnn.py
90 26 7
def custom_load_lvis_json()
in detic/data/datasets/lvis_v1.py
75 25 3
def load_coco_json_mem_efficient()
in detic/data/datasets/register_oid.py
57 24 4
def do_train()
in train_net.py
90 23 3
def accumulate()
in detic/evaluation/oideval.py
77 21 1
def forward()
in detic/modeling/roi_heads/res5_roi_heads.py
70 20 9
def __init__()
in detic/evaluation/oideval.py
64 20 6
def debug_test()
in detic/modeling/debug.py
70 18 8
def _derive_coco_results()
in detic/evaluation/custom_coco_eval.py
77 18 4
def compute_average_precision()
in detic/evaluation/oideval.py
28 16 2
def __call__()
in detic/data/custom_dataset_mapper.py
31 14 2
def do_test()
in train_net.py
35 13 2
def add_detic_config()
in detic/config.py
103 12 1
def __init__()
in detic/modeling/backbone/swintransformer.py
71 12 27
def _prepare()
in detic/evaluation/oideval.py
23 12 1
def compute_iou()
in detic/evaluation/oideval.py
17 12 3