facebookresearch / WyPR
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 275 units with 3,853 lines of code in units (70.1% of code).
    • 3 very long units (344 lines of code)
    • 6 long units (400 lines of code)
    • 51 medium size units (1,393 lines of code)
    • 57 small units (833 lines of code)
    • 158 very small units (883 lines of code)
8% | 10% | 36% | 21% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 9% | 34% | 22% | 24%
cpp0% | 25% | 61% | 12% | 0%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
wypr/dataset32% | 6% | 26% | 21% | 13%
wypr/evaluation0% | 46% | 20% | 13% | 18%
wypr/utils0% | 10% | 41% | 25% | 22%
shape_det0% | 34% | 23% | 33% | 7%
wypr/modeling0% | 0% | 49% | 18% | 32%
gss0% | 0% | 33% | 18% | 47%
wypr/tools0% | 0% | 79% | 20% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __getitem__()
in wypr/dataset/s3dis/s3dis.py
122 22 2
def write_bbox()
in wypr/dataset/scannet/vis.py
113 16 2
def __getitem__()
in wypr/dataset/scannet/scannet.py
109 21 2
def make_confusion_matrix()
in wypr/evaluation/cf_matrix.py
77 20 14
def parse_predictions()
in wypr/evaluation/ap_helper.py
76 27 8
int main()
in shape_det/region_growing_on_point_set_3.cpp
75 6 2
def export()
in wypr/dataset/scannet/preprocess_scannet_all_points.py
64 18 7
def eval_prop_cls()
in wypr/utils/eval_prop.py
55 21 4
def eval_det_cls()
in wypr/utils/eval_det.py
53 17 5
def create_color_palette()
in wypr/dataset/scannet/util.py
44 1 0
def evaluate_iou()
in wypr/evaluation/iou_helper.py
44 11 4
def forward()
in wypr/modeling/backbone/pointnet2/pointnet2_utils.py
40 10 4
def forward()
in wypr/modeling/backbone/pointnet2/pointnet2_modules.py
39 10 4
def _run_gss()
in gss/selective_search_3d_run.py
36 10 3
def __init__()
in wypr/modeling/backbone/backbone_pointnet2.py
36 1 2
def __init__()
in wypr/dataset/s3dis/s3dis.py
35 10 9
def nms_3d_faster_samecls()
in wypr/utils/nms.py
35 3 3
def eval_det_multiprocessing()
in wypr/utils/eval_det.py
32 15 5
def nms_3d_faster()
in gss/utils.py
31 3 3
def _fix_unassigned_points()
in wypr/dataset/s3dis/process.py
31 5 1