microsoft / diskspd
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 364 units with 8,615 lines of code in units (35.5% of code).
    • 16 very long units (3,982 lines of code)
    • 24 long units (1,693 lines of code)
    • 53 medium size units (1,677 lines of code)
    • 44 small units (654 lines of code)
    • 227 very small units (609 lines of code)
46% | 19% | 19% | 7% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp51% | 20% | 19% | 6% | 3%
h0% | 16% | 23% | 20% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
CmdLineParser81% | 13% | 3% | 1% | <1%
IORequestGenerator52% | 11% | 24% | 8% | 2%
XmlProfileParser56% | 9% | 25% | 7% | <1%
Common23% | 14% | 24% | 14% | 23%
ResultParser32% | 45% | 15% | 1% | 3%
XmlResultParser0% | 61% | 24% | 6% | 7%
CmdRequestCreator0% | 71% | 0% | 15% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
bool CmdLineParser::_ReadParametersFromCmdLine()
in CmdLineParser/CmdLineParser.cpp
1004 216 5
DWORD WINAPI threadFunc()
in IORequestGenerator/IORequestGenerator.cpp
461 92 1
bool IORequestGenerator::_GenerateRequestsForTimeSpan()
in IORequestGenerator/IORequestGenerator.cpp
413 68 4
HRESULT XmlProfileParser::_ParseTarget()
in XmlProfileParser/XmlProfileParser.cpp
308 98 2
bool Profile::Validate()
in Common/Common.cpp
262 70 2
void ResultParser::_PrintTarget()
in ResultParser/ResultParser.cpp
196 39 4
string Target::GetXml()
in Common/Common.cpp
182 32 1
bool XmlProfileParser::ParseFile()
in XmlProfileParser/XmlProfileParser.cpp
179 43 4
void CmdLineParser::_DisplayUsageInfo()
in CmdLineParser/CmdLineParser.cpp
177 1 1
HRESULT XmlProfileParser::_ParseEtw()
in XmlProfileParser/XmlProfileParser.cpp
121 36 2
HRESULT XmlProfileParser::_ParseTimeSpan()
in XmlProfileParser/XmlProfileParser.cpp
121 39 3
void ResultParser::_PrintSection()
in ResultParser/ResultParser.cpp
119 20 3
bool IORequestGenerator::_CreateFile()
in IORequestGenerator/IORequestGenerator.cpp
117 22 4
bool CmdLineParser::_ParseAffinity()
in CmdLineParser/CmdLineParser.cpp
110 24 2
static bool issueNextIO()
in IORequestGenerator/IORequestGenerator.cpp
110 18 4
UINT64 GetDynamicPartitionSize()
in IORequestGenerator/IORequestGenerator.cpp
102 15 1
string ResultParser::ParseResults()
in ResultParser/ResultParser.cpp
100 13 3
void XmlResultParser::_PrintLatencyPercentiles()
in XmlResultParser/XmlResultParser.cpp
93 17 1
bool CmdLineParser::_ParseRandomDistribution()
in CmdLineParser/CmdLineParser.cpp
87 16 2
83 12 1