facebookresearch / d2go
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 1,001 units with 10,119 lines of code in units (58.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (168 lines of code)
    • 26 medium complex units (1,418 lines of code)
    • 54 simple units (1,522 lines of code)
    • 920 very simple units (7,011 lines of code)
0% | 1% | 14% | 15% | 69%
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% | 1% | 14% | 15% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
projects_oss/detr0% | 4% | 16% | 14% | 64%
d2go/data0% | 0% | 15% | 22% | 61%
d2go/modeling0% | 0% | 14% | 13% | 72%
d2go/runner0% | 0% | 16% | 20% | 62%
d2go/utils0% | 0% | 8% | 11% | 80%
d2go/export0% | 0% | 18% | 0% | 81%
d2go/evaluation0% | 0% | 12% | 35% | 52%
d2go/optimizer0% | 0% | 0% | 20% | 79%
ROOT0% | 0% | 0% | 100% | 0%
d2go0% | 0% | 0% | 0% | 100%
tools0% | 0% | 0% | 0% | 100%
d2go/config0% | 0% | 0% | 0% | 100%
d2go/model_zoo0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in projects_oss/detr/main.py
168 41 1
def _original_call()
in d2go/data/dataset_mappers/d2go_dataset_mapper_impl.py
81 23 2
def __call__()
in projects_oss/detr/detr/datasets/coco.py
47 20 3
def forward()
in projects_oss/detr/detr/models/segmentation.py
100 20 4
def _original_call()
in d2go/data/dataset_mappers/rotated_dataset_mapper.py
59 19 2
def extended_lvis_load()
in d2go/data/extended_lvis.py
70 19 3
def _do_test()
in d2go/runner/default_runner.py
76 18 5
def resize()
in projects_oss/detr/detr/datasets/transforms.py
49 15 4
def build()
in projects_oss/detr/detr/models/detr.py
47 15 1
def post_training_quantize()
in d2go/modeling/quantization.py
36 15 3
def before_step()
in d2go/modeling/quantization.py
60 15 1
def _apply_eager_mode_quant()
in d2go/modeling/meta_arch/rcnn.py
55 15 2
def evaluate()
in projects_oss/detr/detr/datasets/coco_eval.py
34 14 1
def __init__()
in projects_oss/detr/detr/d2/detr.py
137 14 2
def __call__()
in projects_oss/detr/detr/d2/dataset_mapper.py
33 14 2
def fetch_checkpoints_till_final()
in d2go/utils/validation_monitor.py
58 14 1
def forward()
in d2go/modeling/subclass.py
51 14 5
def _load_model()
in d2go/modeling/quantization.py
22 14 2
def forward()
in projects_oss/detr/detr/models/deformable_detr.py
70 13 2
def build()
in projects_oss/detr/detr/models/deformable_detr.py
47 13 1