facebookresearch / co3d
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 112 units with 1,021 lines of code in units (46.4% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (136 lines of code)
    • 8 medium size units (234 lines of code)
    • 15 small units (225 lines of code)
    • 87 very small units (426 lines of code)
0% | 13% | 22% | 22% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 13% | 22% | 22% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dataset0% | 22% | 21% | 23% | 33%
evaluation0% | 0% | 56% | 11% | 33%
ROOT0% | 0% | 33% | 22% | 44%
tools0% | 0% | 10% | 25% | 64%
models0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _filter_db()
in dataset/co3d_dataset.py
73 27 1
def __getitem__()
in dataset/co3d_dataset.py
63 7 2
def collate()
in dataset/co3d_dataset.py
47 21 2
def _get_pytorch3d_camera()
in dataset/co3d_dataset.py
34 8 4
def aggregate_nvs_results()
in evaluation/evaluate_new_view_synthesis.py
29 14 1
def _load_mask_depth()
in dataset/co3d_dataset.py
27 5 4
def pretty_print_nvs_metrics()
in evaluation/evaluate_new_view_synthesis.py
27 15 1
def main()
in eval_demo.py
24 8 0
def cat_dataclass()
in tools/utils.py
23 11 2
def _dataclass_from_dict()
in dataset/types.py
23 15 2
def _load_subset_lists()
in dataset/co3d_dataset.py
20 6 1
def _resize_image()
in dataset/co3d_dataset.py
20 4 3
def _sample_batch()
in dataset/scene_batch_sampler.py
18 4 2
def _download_with_progress_bar()
in download_dataset.py
16 3 3
def select_cameras()
in tools/camera_utils.py
16 7 4
def _load_crop_images()
in dataset/co3d_dataset.py
16 5 4
def _load_crop_fg_probability()
in dataset/co3d_dataset.py
15 6 2
def _load_pointcloud()
in dataset/co3d_dataset.py
15 3 2
def concatenate_cameras()
in tools/camera_utils.py
14 7 1
def _get_clamp_bbox()
in dataset/co3d_dataset.py
14 4 3