facebookresearch / consistent_depth
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 219 units with 2,371 lines of code in units (75.4% of code).
    • 1 very long units (141 lines of code)
    • 3 long units (222 lines of code)
    • 29 medium size units (838 lines of code)
    • 33 small units (501 lines of code)
    • 153 very small units (669 lines of code)
5% | 9% | 35% | 21% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py5% | 9% | 35% | 21% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT13% | 14% | 36% | 22% | 12%
loss0% | 42% | 13% | 13% | 30%
tools0% | 0% | 48% | 24% | 27%
utils0% | 0% | 27% | 19% | 52%
loaders0% | 0% | 62% | 0% | 37%
monodepth0% | 0% | 31% | 28% | 40%
optimizer0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def calibrate_scale()
in scale_calibration.py
141 19 4
def fine_tune()
in depth_fine_tuning.py
83 14 2
def geometry_consistency_loss()
in loss/consistency_loss.py
70 9 4
def eval_and_save()
in depth_fine_tuning.py
69 18 4
def infer()
in optical_flow_flownet2_homography.py
43 2 5
43 19 2
def pipeline()
in process.py
41 5 2
40 6 3
39 9 1
def main()
in tools/make_video.py
37 5 1
def __getitem__()
in loaders/video_dataset.py
35 9 2
def parse_frame_range()
in utils/frame_range.py
34 9 1
33 11 3
def save_raw_float32_image()
in utils/image_io.py
31 4 2
def __init__()
in loaders/video_dataset.py
29 6 3
def augment_args()
in tools/make_video.py
27 9 1
def add_arguments()
in tools/colmap_processor.py
27 1 1
def getimage()
in optical_flow_flownet2_homography.py
27 5 3
def add_arguments()
in depth_fine_tuning.py
27 1 1
def save_depth()
in depth_fine_tuning.py
27 4 3