amazon-research / progressive-coordinate-transforms
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 287 units with 4,701 lines of code in units (82.5% of code).
    • 4 very long units (423 lines of code)
    • 12 long units (917 lines of code)
    • 56 medium size units (1,701 lines of code)
    • 58 small units (852 lines of code)
    • 157 very small units (808 lines of code)
8% | 19% | 36% | 18% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py11% | 11% | 35% | 18% | 22%
cpp0% | 44% | 38% | 15% | 1%
h0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/losses82% | 0% | 8% | 0% | 9%
tools/data_prepare39% | 16% | 21% | 10% | 11%
tools/kitti_eval0% | 44% | 38% | 16% | 1%
lib/helpers0% | 29% | 34% | 21% | 13%
tools/waymo0% | 25% | 34% | 17% | 22%
lib/utils0% | 0% | 42% | 24% | 32%
lib/datasets0% | 0% | 63% | 9% | 26%
lib/models0% | 0% | 91% | 0% | 8%
lib/backbones0% | 0% | 19% | 39% | 41%
tools0% | 0% | 65% | 11% | 23%
lib/extensions0% | 0% | 0% | 65% | 35%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_loss()
in lib/losses/patchnet_loss.py
111 15 11
def extract_patch_data()
in tools/data_prepare/patch_data_prepare_val.py
106 10 5
def extract_patch_data_val_detection()
in tools/data_prepare/patch_data_prepare_val.py
105 12 4
def get_loss()
in lib/losses/fpointnet_loss.py
101 9 12
tPrData computeStatistics()
in tools/kitti_eval/evaluate_object_3d_offline_ap11.cpp
97 46 8
tPrData computeStatistics()
in tools/kitti_eval/evaluate_object_3d_offline_ap40.cpp
97 46 8
bool eval()
in tools/kitti_eval/evaluate_object_3d_offline_ap11.cpp
92 21 3
bool eval()
in tools/kitti_eval/evaluate_object_3d_offline_ap40.cpp
92 21 3
def extract_patch_data_rgb_detection()
in tools/data_prepare/patch_data_prepare_val.py
88 9 5
def build_dataloader()
in lib/helpers/data_builder.py
78 10 3
def save_label()
in tools/waymo/converter.py
68 17 4
def test_one_epoch()
in lib/helpers/tester_helper.py
66 10 1
def convert_range_image_to_point_cloud()
in tools/waymo/converter.py
63 5 6
bool eval_class()
in tools/kitti_eval/evaluate_object_3d_offline_ap11.cpp
59 11 7
bool eval_class()
in tools/kitti_eval/evaluate_object_3d_offline_ap40.cpp
59 11 7
def eval_one_epoch_1()
in lib/helpers/trainer_helper.py
58 7 1
def __init__()
in lib/datasets/frustum_dataset.py
50 3 10
def __init__()
in lib/models/patchnet_pct.py
49 5 5
def __getitem__()
in lib/datasets/frustum_dataset.py
47 9 2
def compute_box3d_iou()
in lib/utils/fpointnet_utils.py
47 4 10