facebookresearch / pifuhd
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 178 units with 2,928 lines of code in units (81.9% of code).
    • 2 very long units (234 lines of code)
    • 6 long units (430 lines of code)
    • 37 medium size units (1,133 lines of code)
    • 45 small units (652 lines of code)
    • 88 very small units (479 lines of code)
7% | 14% | 38% | 22% | 16%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 14% | 38% | 22% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib14% | 6% | 37% | 24% | 16%
lib/render/gl25% | 0% | 10% | 48% | 15%
lib/render0% | 36% | 22% | 9% | 31%
lib/data0% | 27% | 36% | 28% | 7%
apps0% | 34% | 55% | 8% | 1%
lib/model0% | 8% | 64% | 13% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def initialize()
in lib/options.py
123 7 2
def __init__()
in lib/render/gl/render.py
111 16 8
def load_obj_mesh_mtl()
in lib/render/mesh.py
95 35 1
def load_obj_mesh()
in lib/render/mesh.py
78 22 3
def get_item()
in lib/data/EvalWPoseDataset.py
78 19 2
def recon()
in apps/recon.py
64 14 2
def query()
in lib/model/HGPIFuMRNet.py
59 10 6
def run()
in lib/evaluator.py
56 11 3
47 4 5
def get_item()
in lib/data/EvalDataset.py
47 3 2
def calc_normal()
in lib/model/HGPIFuMRNet.py
46 4 8
def __init__()
in lib/model/HGPIFuNetwNML.py
44 5 4
def reconstruction()
in lib/mesh_util.py
43 6 10
def __init__()
in lib/model/HGFilters.py
41 11 8
def gen_mesh()
in apps/recon.py
40 8 8
def calc_normal()
in lib/model/HGPIFuNetwNML.py
36 2 7
def gen_mesh_imgColor()
in apps/recon.py
36 7 8
def __init__()
in lib/model/HGPIFuMRNet.py
35 3 5
def query()
in lib/model/HGPIFuNetwNML.py
34 6 7
def MVP_from_P()
in lib/render/camera.py
33 1 5