facebookresearch / 3detr
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 224 units with 3,326 lines of code in units (72.7% of code).
    • 2 very long units (263 lines of code)
    • 6 long units (439 lines of code)
    • 46 medium size units (1,333 lines of code)
    • 47 small units (667 lines of code)
    • 123 very small units (624 lines of code)
7% | 13% | 40% | 20% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 13% | 38% | 20% | 19%
pyx0% | 0% | 92% | 0% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
datasets54% | 12% | 5% | 12% | 13%
ROOT0% | 33% | 36% | 18% | 11%
utils0% | 8% | 48% | 20% | 22%
models0% | 10% | 46% | 24% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __getitem__()
in datasets/sunrgbd.py
149 13 2
def __getitem__()
in datasets/scannet.py
114 11 2
92 5 0
def main()
in main.py
78 12 2
def get_box_predictions()
in models/model_3detr.py
73 3 4
70 18 6
def __init__()
in datasets/scannet.py
63 5 1
63 8 6
def __call__()
in utils/random_cuboid.py
46 10 4
def forward()
in criterion.py
46 5 3
def enclosing_box3d_vol()
in utils/box_util.py
42 1 2
def loss_angle()
in criterion.py
40 4 4
def forward()
in models/transformer.py
39 10 11
def get_3d_box_batch_tensor()
in utils/box_util.py
38 4 3
37 3 3
def build_encoder()
in models/model_3detr.py
37 4 1
def write_oriented_bbox()
in utils/pc_util.py
36 7 3
36 4 4
def forward()
in models/transformer.py
34 11 7
def forward()
in models/transformer.py
34 9 7