microsoft / DirectXMath
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 876 units with 13,169 lines of code in units (38.3% of code).
    • 12 very long units (1,519 lines of code)
    • 49 long units (3,263 lines of code)
    • 143 medium size units (4,356 lines of code)
    • 156 small units (2,375 lines of code)
    • 516 very small units (1,656 lines of code)
11% | 24% | 33% | 18% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
inl12% | 24% | 39% | 18% | 5%
cpp20% | 38% | 11% | 13% | 16%
h0% | 16% | 13% | 20% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Inc12% | 23% | 38% | 18% | 7%
SHMath20% | 38% | 11% | 13% | 16%
XDSP0% | 57% | 25% | 13% | 3%
Extensions0% | 0% | 7% | 29% | 63%
MatrixStack0% | 0% | 0% | 12% | 87%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
inl
inline bool XM_CALLCONV Intersects()
in Inc/DirectXCollision.inl
192 40 6
inl
150 12 1
150 4 1
HRESULT DirectX::SHProjectCubeMap()
in SHMath/DirectXSHD3D11.cpp
148 39 6
HRESULT DirectX::SHProjectCubeMap()
in SHMath/DirectXSHD3D12.cpp
121 36 6
inl
113 11 1
inl
111 1 1
inl
inline XMVECTOR XM_CALLCONV XMVectorLogE()
in Inc/DirectXMathVector.inl
111 1 1
109 2 3
inl
inline XMVECTOR XM_CALLCONV XMVectorLog2()
in Inc/DirectXMathVector.inl
109 1 1
inl
103 2 1
102 10 3
inl
99 10 1
inl
inline XMVECTOR XM_CALLCONV XMVectorExp2()
in Inc/DirectXMathVector.inl
93 1 1
inl
inline XMVECTOR XM_CALLCONV XMLoadFloat3PK()
in Inc/DirectXPackedVector.inl
89 13 1
89 17 7
inl
inline XMVECTOR XM_CALLCONV XMVectorATan()
in Inc/DirectXMathVector.inl
88 1 1
87 1 1
86 18 7
81 2 1