facebookresearch / meshrcnn
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 212 units with 3,404 lines of code in units (72.0% of code).
    • 2 very long units (223 lines of code)
    • 7 long units (431 lines of code)
    • 41 medium size units (1,319 lines of code)
    • 61 small units (939 lines of code)
    • 101 very small units (492 lines of code)
6% | 12% | 38% | 27% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py6% | 12% | 38% | 27% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
meshrcnn/utils20% | 9% | 37% | 22% | 9%
tools19% | 11% | 39% | 21% | 8%
shapenet/utils0% | 23% | 28% | 25% | 21%
meshrcnn/modeling0% | 15% | 46% | 25% | 11%
meshrcnn/data0% | 21% | 33% | 42% | 2%
shapenet/evaluation0% | 51% | 46% | 0% | 1%
shapenet/modeling0% | 0% | 38% | 27% | 34%
shapenet/data0% | 0% | 50% | 32% | 17%
meshrcnn/structures0% | 0% | 27% | 45% | 27%
meshrcnn/config0% | 0% | 100% | 0% | 0%
shapenet/config0% | 0% | 100% | 0% | 0%
meshrcnn/evaluation0% | 0% | 22% | 62% | 14%
shapenet/solver0% | 0% | 0% | 59% | 40%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def visualize_minibatch()
in meshrcnn/utils/vis.py
114 16 4
def training_loop()
in tools/train_net_shapenet.py
109 41 8
def _forward_shape()
in meshrcnn/modeling/roi_heads/roi_heads.py
87 24 3
def handle_model()
in tools/preprocess_shapenet.py
66 11 5
62 3 3
def load_pix3d_json()
in meshrcnn/data/datasets/pix3d.py
57 10 3
def evaluate_test()
in shapenet/evaluation/eval.py
55 12 3
def estimate()
in meshrcnn/utils/projtransform.py
53 12 4
51 3 3
def evaluate_test_p2m()
in shapenet/evaluation/eval.py
49 11 2
def __getitem__()
in shapenet/data/mesh_vox.py
49 9 2
def main_worker()
in tools/train_net_shapenet.py
47 5 2
def main()
in tools/preprocess_shapenet.py
45 14 1
def get_meshrcnn_cfg_defaults()
in meshrcnn/config/config.py
45 11 1
def get_shapenet_cfg()
in shapenet/config/config.py
45 5 0
def _compute_sampling_metrics()
in meshrcnn/utils/metrics.py
44 15 6
def voxel_rcnn_loss()
in meshrcnn/modeling/roi_heads/voxel_head.py
42 7 3
40 3 3
def __init__()
in meshrcnn/modeling/roi_heads/voxel_head.py
39 8 3
def draw_pix3d_dict()
in meshrcnn/utils/vis.py
38 11 2