amazon-research / network-deconvolution-pp
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 819 units with 10,919 lines of code in units (63.1% of code).
    • 5 very long units (694 lines of code)
    • 22 long units (1,489 lines of code)
    • 115 medium size units (3,527 lines of code)
    • 185 small units (2,770 lines of code)
    • 492 very small units (2,439 lines of code)
6% | 13% | 32% | 25% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py6% | 12% | 33% | 25% | 22%
cpp0% | 83% | 12% | 0% | 3%
h0% | 0% | 0% | 84% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Segmentation31% | 20% | 9% | 13% | 25%
Classification26% | 18% | 39% | 5% | 9%
Classification/models7% | 4% | 35% | 29% | 22%
MaskRCNN/pytorch/maskrcnn_benchmark0% | 13% | 32% | 29% | 24%
MaskRCNN/pytorch/tools0% | 62% | 24% | 9% | 2%
Segmentation/models/segmentation0% | 10% | 37% | 21% | 29%
Segmentation/datasets0% | 25% | 32% | 22% | 19%
Segmentation/models0% | 0% | 31% | 45% | 22%
MaskRCNN/pytorch0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main_worker()
in Classification/main_imagenet.py
218 67 3
def create_ade20k_label_colormap()
in Segmentation/train.py
154 1 0
def main()
in Segmentation/train.py
112 37 1
def forward()
in Classification/models/rfnorm.py
108 19 3
def forward()
in Classification/models/rfnorm.py
102 23 2
def convert_cityscapes_instance_only()
in MaskRCNN/pytorch/tools/cityscapes/convert_cityscapes_to_coco.py
91 14 2
def eval_net()
in Classification/net_util.py
84 21 2
void pre_calc_for_bilinear_interpolate()
in MaskRCNN/pytorch/maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp
83 11 13
void ROIAlignForward_cpu_kernel()
in MaskRCNN/pytorch/maskrcnn_benchmark/csrc/cpu/ROIAlign_cpu.cpp
78 10 11
def main()
in MaskRCNN/pytorch/tools/train_net.py
72 12 0
def forward()
in MaskRCNN/pytorch/maskrcnn_benchmark/layers/deconv.py
72 15 3
def forward()
in Classification/models/deconv.py
72 15 3
def __init__()
in MaskRCNN/pytorch/maskrcnn_benchmark/modeling/roi_heads/box_head/roi_box_feature_extractors.py
71 16 2
def forward_for_single_feature_map()
in MaskRCNN/pytorch/maskrcnn_benchmark/modeling/rpn/inference.py
69 17 4
69 1 0
def train()
in MaskRCNN/pytorch/tools/train_net.py
68 10 6
def forward()
in MaskRCNN/pytorch/maskrcnn_benchmark/layers/deconv.py
68 18 2
def forward()
in Segmentation/models/segmentation/deconv.py
68 18 2
def forward()
in Classification/models/deconv.py
68 18 2
def calc_detection_voc_prec_rec()
in MaskRCNN/pytorch/maskrcnn_benchmark/data/datasets/evaluation/voc/voc_eval.py
66 12 3