microsoft / DirectXMesh
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 215 units with 9,642 lines of code in units (51.4% of code).
    • 26 very long units (5,208 lines of code)
    • 25 long units (1,689 lines of code)
    • 49 medium size units (1,592 lines of code)
    • 55 small units (800 lines of code)
    • 60 very small units (353 lines of code)
54% | 17% | 16% | 8% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp50% | 19% | 17% | 8% | 3%
h73% | 7% | 11% | 5% | 2%
inl0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
DirectXMesh42% | 19% | 21% | 10% | 5%
Meshconvert64% | 19% | 8% | 5% | 1%
Utilities83% | 3% | 9% | 3% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
HRESULT Mesh::ExportToSDKMESH()
in Meshconvert/Mesh.cpp
542 97 8
int __cdecl wmain()
in Meshconvert/Meshconvert.cpp
494 121 2
HRESULT VBWriter::Impl::Write()
in DirectXMesh/DirectXMeshVBWriter.cpp
333 101 5
HRESULT VBReader::Impl::Read()
in DirectXMesh/DirectXMeshVBReader.cpp
303 97 5
HRESULT CleanImpl()
in DirectXMesh/DirectXMeshClean.cpp
300 85 1
HRESULT Mesh::ExportToCMO()
in Meshconvert/Mesh.cpp
291 69 3
HRESULT Load()
in Utilities/WaveFrontReader.h
259 50 2
HRESULT OptimizeFacesImpl()
in DirectXMesh/DirectXMeshOptimizeLRU.cpp
238 49 1
HRESULT ConvertPointRepsToAdjacencyImpl()
in DirectXMesh/DirectXMeshAdjacency.cpp
212 46 1
inline uint32_t ComputeFVF()
in Utilities/FlexibleVertexFormat.h
195 66 1
HRESULT ValidateIndices()
in DirectXMesh/DirectXMeshValidate.cpp
173 58 1
inline uint32_t ComputeFVF()
in Utilities/FlexibleVertexFormat.h
158 54 1
HRESULT GeneratePointReps()
in DirectXMesh/DirectXMeshAdjacency.cpp
152 36 1
HRESULT Meshletize()
in DirectXMesh/DirectXMeshletGenerator.cpp
149 27 3
HRESULT VertexCacheStripReorderImpl()
in DirectXMesh/DirectXMeshOptimizeTVC.cpp
144 34 1
inline bool CreateDeclFromFVF()
in Utilities/FlexibleVertexFormat.h
129 22 2
HRESULT ComputeTangentFrameImpl()
in DirectXMesh/DirectXMeshTangentFrame.cpp
128 30 1
inline bool CreateInputLayoutFromFVF()
in Utilities/FlexibleVertexFormat.h
121 22 2
inline bool CreateInputLayoutFromFVF()
in Utilities/FlexibleVertexFormat.h
121 22 2
HRESULT Mesh::Clean()
in Meshconvert/Mesh.cpp
118 31 0