facebookresearch / DepthContrast
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 215 units with 3,594 lines of code in units (76.4% of code).
    • 4 very long units (648 lines of code)
    • 9 long units (512 lines of code)
    • 41 medium size units (1,279 lines of code)
    • 41 small units (587 lines of code)
    • 120 very small units (568 lines of code)
18% | 14% | 35% | 16% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py18% | 14% | 35% | 16% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
models/trunks26% | 10% | 37% | 17% | 9%
datasets/transforms37% | 0% | 22% | 17% | 22%
datasets0% | 48% | 33% | 5% | 12%
models0% | 36% | 40% | 5% | 16%
datasets/collators0% | 52% | 18% | 26% | 2%
criterions0% | 50% | 22% | 12% | 14%
utils0% | 0% | 34% | 33% | 31%
ROOT0% | 0% | 81% | 18% | 0%
data/waymo0% | 0% | 87% | 0% | 12%
data/scannet0% | 0% | 39% | 0% | 60%
data/redwood0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_transform3d()
in datasets/transforms/augment3d.py
216 38 3
def network_initialization()
in models/trunks/spconv/models/res16unet.py
170 4 4
def network_initialization()
in models/trunks/spconv/models/resunet.py
133 3 5
def network_initialization()
in models/trunks/spconv/models/resunet.py
129 3 5
def point_vox_moco_collator()
in datasets/collators/point_vox_moco_lidar_collator.py
62 23 1
def get_optimizer_params()
in models/base_ssl3d_model.py
60 27 1
def forward()
in models/trunks/spconv/models/res16unet.py
59 3 3
def __init__()
in datasets/depth_dataset.py
58 6 2
def __init__()
in models/trunks/spconv_unet.py
58 2 3
def __getitem__()
in datasets/depth_dataset.py
57 8 2
def forward()
in criterions/nce_loss_moco.py
54 9 2
def _single_input_forward_MOCO()
in models/base_ssl3d_model.py
53 21 5
def __init__()
in models/trunks/pointnet.py
51 3 5
def extract()
in data/waymo/extract_pointcloud.py
48 6 1
def forward()
in models/trunks/spconv_unet.py
45 8 3
def network_initialization()
in models/trunks/spconv/models/resnet.py
43 3 4
def initialize_coords()
in models/trunks/spconv/models/conditional_random_fields.py
42 3 4
def run_phase()
in main.py
42 14 10
def _batch_shuffle_ddp()
in models/base_ssl3d_model.py
41 11 4
def _make_layer()
in models/trunks/spconv/models/resnet.py
41 4 8