facebookresearch / detr
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 207 units with 2,548 lines of code in units (86.0% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (181 lines of code)
    • 10 medium complex units (408 lines of code)
    • 14 simple units (419 lines of code)
    • 181 very simple units (1,540 lines of code)
0% | 7% | 16% | 16% | 60%
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% | 7% | 16% | 16% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 43% | 9% | 0% | 46%
datasets0% | 0% | 26% | 10% | 63%
models0% | 0% | 12% | 11% | 75%
util0% | 0% | 10% | 32% | 56%
d20% | 0% | 35% | 33% | 30%
d2/detr0% | 0% | 12% | 38% | 49%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main.py
112 39 1
def evaluate()
in engine.py
69 27 7
def __call__()
in datasets/coco.py
45 20 3
def forward()
in models/segmentation.py
76 20 4
def plot_logs()
in util/plot_utils.py
47 16 4
def resize()
in datasets/transforms.py
43 15 4
def forward()
in models/detr.py
24 15 3
def evaluate()
in datasets/coco_eval.py
35 14 1
def __call__()
in d2/detr/dataset_mapper.py
31 14 2
39 13 7
def build_optimizer()
in d2/train_net.py
41 12 3
def __getitem__()
in datasets/coco_panoptic.py
27 11 2
def crop()
in datasets/transforms.py
28 10 3
def main()
in d2/converter.py
38 9 0
def __init__()
in d2/detr/detr.py
70 9 2
def plot_precision_recall()
in util/plot_utils.py
28 8 2
def build()
in models/detr.py
40 8 1
def all_gather()
in util/misc.py
24 7 1
def log_every()
in util/misc.py
53 7 4
17 7 1