facebookresearch / SparseConvNet
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 623 units with 7,904 lines of code in units (59.7% of code).
    • 4 very long units (593 lines of code)
    • 2 long units (163 lines of code)
    • 95 medium size units (2,738 lines of code)
    • 175 small units (2,674 lines of code)
    • 347 very small units (1,736 lines of code)
7% | 2% | 34% | 33% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 2% | 23% | 40% | 24%
cpp5% | 0% | 44% | 34% | 15%
h9% | 6% | 29% | 20% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sparseconvnet9% | 2% | 23% | 40% | 24%
sparseconvnet/SCN17% | 0% | 0% | 39% | 42%
sparseconvnet/SCN/Metadata13% | 8% | 47% | 22% | 8%
sparseconvnet/SCN/CPU0% | 0% | 57% | 41% | 1%
sparseconvnet/SCN/CUDA0% | 0% | 70% | 22% | 6%
sparseconvnet/SCN/Metadata/sparsehash/internal0% | 0% | 17% | 21% | 61%
sparseconvnet/SCN/misc0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
template void dimension()
in sparseconvnet/SCN/pybind.cpp
189 1 2
void blRules()
in sparseconvnet/SCN/Metadata/IOLayersRules.h
146 38 7
def ClassificationTrainValidate()
in sparseconvnet/classificationTrainValidate.py
141 26 3
def SparseVggNet()
in sparseconvnet/networkArchitectures.py
117 14 3
void inputLayerRules()
in sparseconvnet/SCN/Metadata/IOLayersRules.h
99 24 8
def SparseResNet()
in sparseconvnet/networkArchitectures.py
64 8 3
void BatchNormalization_ForwardPass()
in sparseconvnet/SCN/CPU/BatchNormalization.cpp
48 12 16
void Metadata::addSampleFromThresholdedTensor()
in sparseconvnet/SCN/Metadata/Metadata.cpp
48 10 5
Int RSR_InputSgsToRulesAndOutputSgs_OMP()
in sparseconvnet/SCN/Metadata/RandomizedStrideRules.h
44 8 8
void BatchNormalization_BackwardPass()
in sparseconvnet/SCN/CPU/BatchNormalization.cpp
43 11 17
Int Convolution_InputSgsToRulesAndOutputSgs_OMP()
in sparseconvnet/SCN/Metadata/ConvolutionRules.h
41 8 7
Int FullConvolution_InputSgsToRulesAndOutputSgs_OMP()
in sparseconvnet/SCN/Metadata/FullConvolutionRules.h
41 8 7
def forward()
in sparseconvnet/batchNormalization.py
39 1 10
def forward()
in sparseconvnet/fullConvolution.py
38 1 11
def UNet()
in sparseconvnet/networkArchitectures.py
38 8 8
def FullConvolutionalNetIntegratedLinear()
in sparseconvnet/networkArchitectures.py
38 5 8
void AffineReluTrivialConvolution_BackwardPass()
in sparseconvnet/SCN/CPU/AffineReluTrivialConvolution.cpp
38 10 15
def FullyConvolutionalNet()
in sparseconvnet/networkArchitectures.py
37 6 6
void Metadata::setInputSpatialLocations()
in sparseconvnet/SCN/Metadata/Metadata.cpp
36 8 4
def forward()
in sparseconvnet/convolution.py
35 1 10