facebookresearch / DensePose
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 551 units with 9,033 lines of code in units (66.4% of code).
    • 5 very long units (642 lines of code)
    • 30 long units (2,150 lines of code)
    • 91 medium size units (2,873 lines of code)
    • 130 small units (1,882 lines of code)
    • 295 very small units (1,486 lines of code)
7% | 23% | 31% | 20% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 24% | 31% | 20% | 16%
pyx0% | 0% | 92% | 0% | 7%
cc0% | 0% | 0% | 64% | 35%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
detectron/modeling13% | 16% | 29% | 15% | 25%
detectron/utils7% | 7% | 32% | 28% | 24%
detectron/roi_data13% | 38% | 17% | 22% | 7%
detectron/datasets5% | 25% | 35% | 22% | 10%
challenge/2019_COCO_DensePose0% | 65% | 25% | 4% | 4%
detectron/core0% | 24% | 36% | 20% | 18%
tools0% | 15% | 68% | 14% | 1%
detectron/ops0% | 0% | 23% | 60% | 15%
challenge0% | 0% | 0% | 71% | 28%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def add_fpn_retinanet_outputs()
in detectron/modeling/retinanet_heads.py
160 24 4
def vis_one_image()
in detectron/utils/vis.py
140 31 14
def add_body_uv_rcnn_blobs()
in detectron/roi_data/body_uv_rcnn.py
124 11 5
def _add_gt_annotations()
in detectron/datasets/json_dataset.py
112 26 2
def add_fpn()
in detectron/modeling/FPN.py
106 13 2
def _get_rpn_blobs()
in detectron/roi_data/rpn.py
97 13 5
def summarize()
in detectron/datasets/densepose_cocoeval.py
96 18 1
def add_fpn_rpn_outputs()
in detectron/modeling/FPN.py
96 12 4
def evaluateImg()
in challenge/2019_COCO_DensePose/densepose_cocoeval.py
96 75 6
def summarize()
in challenge/2019_COCO_DensePose/densepose_cocoeval.py
96 18 1
def evaluateImg()
in detectron/datasets/densepose_cocoeval.py
92 70 5
def colormap()
in detectron/utils/colormap.py
88 2 1
def voc_eval()
in detectron/datasets/voc_eval.py
86 25 7
def accumulate()
in detectron/datasets/densepose_cocoeval.py
86 35 2
def accumulate()
in challenge/2019_COCO_DensePose/densepose_cocoeval.py
86 35 2
def _prepare()
in challenge/2019_COCO_DensePose/densepose_cocoeval.py
81 29 1
def _get_retinanet_blobs()
in detectron/roi_data/retinanet.py
79 1 6
def _prepare()
in detectron/datasets/densepose_cocoeval.py
76 28 1
def im_detect_bbox_aug()
in detectron/core/test.py
72 16 3
def add_body_uv_losses()
in detectron/modeling/body_uv_rcnn_heads.py
67 4 2