facebookresearch / DeepSDF
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 80 units with 1,698 lines of code in units (65.9% of code).
    • 3 very long units (547 lines of code)
    • 6 long units (361 lines of code)
    • 13 medium size units (401 lines of code)
    • 12 small units (162 lines of code)
    • 46 very small units (227 lines of code)
32% | 21% | 23% | 9% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp37% | 26% | 25% | 7% | 2%
py26% | 15% | 21% | 12% | 24%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src37% | 26% | 25% | 7% | 3%
ROOT35% | 20% | 16% | 6% | 20%
deep_sdf0% | 0% | 29% | 21% | 48%
networks0% | 0% | 68% | 26% | 4%
deep_sdf/metrics0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int main()
in src/PreprocessMesh.cpp
211 20 2
def main_function()
in train_deep_sdf.py
206 21 3
int main()
in src/SampleVisibleMeshSurface.cpp
130 10 2
void SampleSDFNearSurface()
in src/PreprocessMesh.cpp
72 12 11
void SampleFromSurfaceInside()
in src/SampleVisibleMeshSurface.cpp
63 9 7
def code_to_mesh()
in generate_training_meshes.py
61 5 3
def evaluate()
in evaluate.py
58 5 4
56 11 3
void writeSDFToPLY()
in src/PreprocessMesh.cpp
51 13 5
void SampleFromSurface()
in src/PreprocessMesh.cpp
49 8 3
def load_logs()
in plot_log.py
46 7 2
42 9 2
void main()
in src/ShaderProgram.cpp
32 1 0
def forward()
in networks/deep_sdf_decoder.py
31 16 2
31 8 4
29 5 1
void writeSDFToNPZ()
in src/PreprocessMesh.cpp
28 6 4
void main()
in src/ShaderProgram.cpp
26 4 0
void SavePointsToPLY()
in src/SampleVisibleMeshSurface.cpp
23 3 2
def add_common_args()
in deep_sdf/utils.py
22 1 1