facebookresearch / votenet
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 233 units with 3,306 lines of code in units (62.3% of code).
    • 2 very long units (210 lines of code)
    • 6 long units (409 lines of code)
    • 42 medium size units (1,158 lines of code)
    • 55 small units (853 lines of code)
    • 128 very small units (676 lines of code)
6% | 12% | 35% | 25% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py6% | 13% | 33% | 24% | 21%
cpp0% | 0% | 59% | 40% | 0%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sunrgbd16% | 21% | 8% | 28% | 25%
models15% | 14% | 38% | 22% | 8%
scannet0% | 34% | 13% | 33% | 18%
utils0% | 6% | 46% | 26% | 20%
pointnet20% | 0% | 36% | 22% | 41%
ROOT0% | 0% | 77% | 0% | 22%
pointnet2/_ext_src/src0% | 0% | 59% | 40% | 0%
pointnet2/_ext_src/include0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __getitem__()
in sunrgbd/sunrgbd_detection_dataset.py
105 9 2
def parse_predictions()
in models/ap_helper.py
105 31 2
def dump_results()
in models/dump_helper.py
97 26 4
def data_viz()
in sunrgbd/sunrgbd_data.py
78 13 3
def __getitem__()
in scannet/scannet_detection_dataset.py
71 11 2
def extract_sunrgbd_data()
in sunrgbd/sunrgbd_data.py
57 18 8
def eval_det_cls()
in utils/eval_det.py
53 17 5
def export()
in scannet/load_scannet_data.py
53 15 6
def compute_box_and_sem_cls_loss()
in models/loss_helper.py
46 1 2
def forward()
in pointnet2/pointnet2_utils.py
40 10 4
def forward()
in pointnet2/pointnet2_modules.py
39 10 4
def get_box3d_dim_statistics()
in sunrgbd/sunrgbd_data.py
36 10 3
def __init__()
in models/backbone_module.py
36 1 2
36 19 0
35 3 3
35 19 0
def eval_det_multiprocessing()
in utils/eval_det.py
33 15 5
def nms_3d_faster()
in utils/nms.py
31 3 3
def get_loss()
in models/loss_helper.py
31 2 2
def polygon_clip()
in utils/box_util.py
30 7 2