microsoft / DirectXTex
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 911 units with 41,668 lines of code in units (62.5% of code).
    • 108 very long units (24,622 lines of code)
    • 98 long units (6,848 lines of code)
    • 196 medium size units (6,425 lines of code)
    • 148 small units (2,211 lines of code)
    • 361 very small units (1,562 lines of code)
59% | 16% | 15% | 5% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp62% | 17% | 15% | 3% | 1%
h17% | 6% | 17% | 23% | 34%
inl0% | 0% | 27% | 47% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
DirectXTex52% | 18% | 17% | 6% | 5%
Texconv74% | 15% | 6% | 3% | <1%
Texdiag78% | 13% | 2% | 4% | <1%
DDSTextureLoader56% | 20% | 19% | 2% | <1%
ScreenGrab79% | 10% | 7% | 1% | <1%
Texassemble79% | 7% | 8% | 3% | <1%
WICTextureLoader47% | 10% | 27% | 10% | 3%
DDSView77% | 0% | 15% | 7% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int __cdecl wmain()
in Texconv/texconv.cpp
1973 399 2
HRESULT DumpBCImage()
in Texdiag/texdiag.cpp
1318 104 3
int __cdecl wmain()
in Texassemble/texassemble.cpp
1099 250 2
int __cdecl wmain()
in Texdiag/texdiag.cpp
808 168 2
bool DirectX::_StoreScanline()
in DirectXTex/DirectXTexConvert.cpp
716 191 6
_Use_decl_annotations_ bool DirectX::_LoadScanline()
in DirectXTex/DirectXTexConvert.cpp
688 199 5
void DirectX::_ConvertScanline()
in DirectXTex/DirectXTexConvert.cpp
616 148 5
HRESULT UncompressPixels()
in DirectXTex/DirectXTexTGA.cpp
392 105 1
HRESULT DirectX::LoadFromTGAFile()
in DirectXTex/DirectXTexTGA.cpp
389 78 4
bool DirectX::_StoreScanlineDither()
in DirectXTex/DirectXTexConvert.cpp
358 87 9
HRESULT CreateTextureFromWIC()
in WICTextureLoader/WICTextureLoader11.cpp
337 86 11
HRESULT CreateTextureFromDDS()
in DDSTextureLoader/DDSTextureLoader11.cpp
317 76 4
HRESULT InitDevice()
in DDSView/ddsview.cpp
298 27 1
HRESULT Generate3DMipsCubicFilter()
in DirectXTex/DirectXTexMipmaps.cpp
297 79 4
void EncodeBC1()
in DirectXTex/BC.cpp
258 36 2
HRESULT DirectX::_EncodeDDSHeader()
in DirectXTex/DirectXTexDDS.cpp
253 87 5
HRESULT DirectX::SaveWICTextureToFile()
in ScreenGrab/ScreenGrab12.cpp
252 64 9
HRESULT CreateTextureFromDDS()
in DDSTextureLoader/DDSTextureLoader9.cpp
251 60 3
HRESULT LoadAnimatedGif()
in Texassemble/AnimatedGif.cpp
245 65 3
HRESULT DirectX::SaveWICTextureToFile()
in ScreenGrab/ScreenGrab11.cpp
243 65 7