facebookresearch / PointContrast
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 721 units with 10,085 lines of code in units (73.4% of code).
    • 12 very long units (1,540 lines of code)
    • 11 long units (745 lines of code)
    • 121 medium size units (3,725 lines of code)
    • 140 small units (2,049 lines of code)
    • 437 very small units (2,026 lines of code)
15% | 7% | 36% | 20% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py15% | 7% | 36% | 20% | 20%
cpp0% | 0% | 80% | 19% | 0%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
downstream/votenet_det_new/models19% | 3% | 41% | 19% | 14%
downstream/semseg/models43% | 0% | 33% | 16% | 6%
downstream/semseg/lib12% | 6% | 36% | 16% | 27%
pretrain/pointcontrast/model28% | 0% | 44% | 19% | 8%
downstream/semseg71% | 0% | 18% | 0% | 9%
downstream/votenet_det_new/lib4% | 16% | 34% | 23% | 20%
downstream/votenet_det_new0% | 81% | 0% | 11% | 7%
pretrain/pointcontrast/lib0% | 6% | 44% | 20% | 28%
pretrain/data_preprocess/scannet_pair0% | 0% | 27% | 31% | 41%
pretrain/pointcontrast0% | 0% | 0% | 80% | 20%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def network_initialization()
in downstream/semseg/models/res16unet.py
156 3 5
def network_initialization()
in downstream/votenet_det_new/models/backbone/sparseconv/models/res16unet.py
155 3 5
def network_initialization()
in pretrain/pointcontrast/model/res16unet.py
155 3 5
def network_initialization()
in downstream/semseg/models/resunet.py
133 3 5
def network_initialization()
in downstream/votenet_det_new/models/backbone/sparseconv/models/resunet.py
133 3 5
def network_initialization()
in downstream/semseg/models/resunet.py
129 3 5
def network_initialization()
in downstream/votenet_det_new/models/backbone/sparseconv/models/resunet.py
129 3 5
def train()
in downstream/semseg/lib/train.py
125 33 5
def main()
in downstream/semseg/ddp_main.py
110 22 2
def test()
in downstream/semseg/lib/test.py
105 19 5
def parse_predictions()
in downstream/votenet_det_new/models/ap_helper.py
105 31 2
def __getitem__()
in downstream/votenet_det_new/lib/datasets/sunrgbd/sunrgbd_detection_dataset.py
105 9 2
def dump_results()
in downstream/votenet_det_new/models/dump_helper.py
97 26 4
def main()
in downstream/votenet_det_new/ddp_main.py
96 12 1
def data_viz()
in downstream/votenet_det_new/lib/datasets/sunrgbd/sunrgbd_data.py
78 13 3
def __getitem__()
in downstream/votenet_det_new/lib/datasets/scannet/scannet_detection_dataset.py
71 11 2
def backproject()
in downstream/semseg/lib/pc_utils.py
64 28 9
def initialize_data_loader()
in downstream/semseg/lib/dataset.py
62 10 11
def __init__()
in pretrain/pointcontrast/lib/ddp_trainer.py
60 13 3
def extract_sunrgbd_data()
in downstream/votenet_det_new/lib/datasets/sunrgbd/sunrgbd_data.py
57 18 8