facebookresearch / ContrastiveSceneContexts
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 1,333 units with 18,398 lines of code in units (75.5% of code).
    • 23 very long units (2,884 lines of code)
    • 21 long units (1,413 lines of code)
    • 206 medium size units (6,232 lines of code)
    • 267 small units (3,899 lines of code)
    • 816 very small units (3,970 lines of code)
15% | 7% | 33% | 21% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py16% | 7% | 32% | 21% | 21%
cpp0% | 0% | 72% | 22% | 5%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
downstream/votenet/models19% | 3% | 42% | 19% | 14%
downstream/insseg/models40% | 0% | 31% | 20% | 7%
downstream/semseg/models40% | 0% | 31% | 20% | 7%
downstream/votenet/lib20% | 6% | 39% | 17% | 15%
downstream/insseg/lib19% | 10% | 21% | 20% | 27%
downstream/insseg/datasets10% | 5% | 35% | 22% | 25%
downstream/semseg/datasets10% | 2% | 37% | 23% | 26%
pretrain/contrastive_scene_contexts/model12% | 0% | 49% | 19% | 18%
pretrain/contrastive_scene_contexts/lib6% | 20% | 23% | 22% | 26%
downstream/votenet/datasets6% | 21% | 20% | 27% | 23%
downstream/semseg/lib7% | 17% | 35% | 12% | 26%
pretrain/scannet_pair0% | 0% | 27% | 33% | 39%
pretrain/contrastive_scene_contexts0% | 0% | 0% | 72% | 27%
downstream/votenet0% | 0% | 0% | 0% | 100%
downstream/insseg0% | 0% | 0% | 0% | 100%
downstream/semseg0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def network_initialization()
in downstream/insseg/models/res16unet.py
159 3 5
def network_initialization()
in downstream/semseg/models/res16unet.py
156 3 5
def network_initialization()
in downstream/votenet/models/backbone/sparseconv/models_sparseconv/res16unet.py
155 3 5
def network_initialization()
in pretrain/contrastive_scene_contexts/model/res16unet.py
155 3 5
def __init__()
in downstream/votenet/lib/ddp_trainer.py
137 20 2
def network_initialization()
in downstream/semseg/models/resunet.py
133 3 5
def network_initialization()
in downstream/insseg/models/resunet.py
133 3 5
def test()
in downstream/insseg/lib/test.py
133 20 3
def network_initialization()
in downstream/votenet/models/backbone/sparseconv/models_sparseconv/resunet.py
133 3 5
def train()
in downstream/insseg/lib/ddp_trainer.py
132 25 1
def network_initialization()
in downstream/semseg/models/resunet.py
129 3 5
def network_initialization()
in downstream/insseg/models/resunet.py
129 3 5
def network_initialization()
in downstream/votenet/models/backbone/sparseconv/models_sparseconv/resunet.py
129 3 5
def evaluate_matches()
in downstream/semseg/datasets/evaluation/evaluate_semantic_instance.py
111 41 2
def evaluate_matches()
in downstream/semseg/datasets/evaluation/scannet_benchmark_utils/scripts/evaluate_semantic_instance.py
111 41 2
def evaluate_matches()
in downstream/insseg/datasets/evaluation/evaluate_semantic_instance.py
111 41 2
def evaluate_matches()
in downstream/insseg/datasets/evaluation/scannet_benchmark_utils/scripts/evaluate_semantic_instance.py
111 41 2
def evaluate_matches()
in pretrain/contrastive_scene_contexts/lib/evaluation/evaluate_semantic_instance.py
111 41 2
def parse_predictions()
in downstream/votenet/models/ap_helper.py
105 31 2
def generate_bbox_mesh()
in downstream/votenet/lib/utils/io3d.py
105 15 1