facebookresearch / maskrcnn-benchmark
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 580 units with 7,320 lines of code in units (47.6% of code).
    • 2 very long units (226 lines of code)
    • 9 long units (591 lines of code)
    • 88 medium size units (2,605 lines of code)
    • 140 small units (2,071 lines of code)
    • 341 very small units (1,827 lines of code)
3% | 8% | 35% | 28% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 5% | 34% | 29% | 27%
cpp0% | 83% | 12% | 0% | 3%
h0% | 0% | 66% | 33% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
maskrcnn_benchmark/data15% | 12% | 37% | 11% | 24%
maskrcnn_benchmark/csrc0% | 35% | 44% | 19% | 1%
tools/cityscapes0% | 46% | 35% | 6% | 12%
maskrcnn_benchmark/layers0% | 8% | 31% | 34% | 26%
tools0% | 39% | 60% | 0% | 0%
maskrcnn_benchmark/modeling0% | 0% | 34% | 37% | 28%
maskrcnn_benchmark/structures0% | 0% | 27% | 38% | 33%
maskrcnn_benchmark/utils0% | 0% | 33% | 26% | 39%
maskrcnn_benchmark/engine0% | 0% | 42% | 53% | 4%
ROOT0% | 0% | 100% | 0% | 0%
maskrcnn_benchmark/config0% | 0% | 56% | 20% | 22%
maskrcnn_benchmark/solver0% | 0% | 0% | 60% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def evaluateMaskMatches()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
114 45 2
def evaluateBoxMatches()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
112 45 2
def convert_cityscapes_instance_only()
in tools/cityscapes/convert_cityscapes_to_coco.py
91 14 2
void pre_calc_for_bilinear_interpolate()
in maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp
83 11 13
void ROIAlignForward_cpu_kernel()
in maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp
78 10 11
def calc_detection_voc_prec_rec()
in maskrcnn_benchmark/data/datasets/evaluation/voc/voc_eval.py
66 12 3
def make_data_loader()
in maskrcnn_benchmark/data/build.py
63 17 5
def backward()
in maskrcnn_benchmark/layers/dcn/deform_conv_func.py
55 5 2
def main()
in tools/train_net.py
53 5 0
at::Tensor nms_cpu_kernel()
in maskrcnn_benchmark/csrc/cpu/nms_cpu.cpp
51 7 3
def convert_abstract_to_coco()
in maskrcnn_benchmark/data/datasets/evaluation/coco/abs_to_coco.py
51 8 3
def train()
in tools/train_net.py
49 5 3
def __init__()
in maskrcnn_benchmark/structures/segmentation_mask.py
49 14 3
def preparePredImage()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
49 18 3
def __init__()
in maskrcnn_benchmark/modeling/rpn/retinanet/retinanet.py
47 5 3
def __init__()
in maskrcnn_benchmark/modeling/roi_heads/box_head/roi_box_feature_extractors.py
43 8 3
def create_builder()
in maskrcnn_benchmark/modeling/backbone/fbnet.py
43 7 1
def printResults()
in maskrcnn_benchmark/data/datasets/evaluation/cityscapes/eval_instances.py
43 9 2
def im_detect_bbox_aug()
in maskrcnn_benchmark/engine/bbox_aug.py
42 13 3
void modulated_deform_conv_backward()
in maskrcnn_benchmark/csrc/deform_conv.h
40 2 24