microsoft / WinDbg-Samples
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 848 units with 13,139 lines of code in units (63.5% of code).
    • 4 very long units (603 lines of code)
    • 39 long units (2,595 lines of code)
    • 158 medium size units (4,802 lines of code)
    • 183 small units (2,764 lines of code)
    • 464 very small units (2,375 lines of code)
4% | 19% | 36% | 21% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp6% | 18% | 36% | 20% | 17%
js0% | 43% | 20% | 19% | 16%
h0% | 10% | 45% | 23% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Exdi/exdigdbsrv6% | 18% | 38% | 16% | 20%
TTDQueries/app-sample2% | 15% | 40% | 27% | 13%
SyntheticTypes0% | 55% | 16% | 13% | 14%
ImageInfo0% | 39% | 20% | 30% | 9%
DataModelHelloWorld/RawCOM0% | 0% | 19% | 62% | 17%
CodeFlow0% | 0% | 59% | 0% | 40%
DataModelHelloWorld/Cpp0% | 0% | 40% | 18% | 40%
FileSystem0% | 0% | 0% | 0% | 100%
DataModelHelloWorld/JavaScript0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
HRESULT XmlDataHelpers::HandleTagAttributeList()
in Exdi/exdigdbsrv/GdbSrvControllerLib/XmlDataHelpers.cpp
283 65 2
bool XmlDataSystemRegister::HandleMapSystemRegAccessCode()
in Exdi/exdigdbsrv/GdbSrvControllerLib/XmlDataHelpers.cpp
108 21 2
HRESULT MainWindow::OnCreate()
in TTDQueries/app-sample/MainWindow.cpp
108 22 0
HRESULT STDMETHODCALLTYPE CLiveExdiGdbSrvServer::Ioctl()
in Exdi/exdigdbsrv/ExdiGdbSrv/LiveExdiGdbSrvServer.cpp
104 19 3
ADDRESS_TYPE CLiveExdiGdbSrvServer::ParseAsynchronousCommandResult()
in Exdi/exdigdbsrv/ExdiGdbSrv/LiveExdiGdbSrvServer.cpp
97 17 2
function __evaluateStack()
in SyntheticTypes/SynTypes.js
93 25 2
HRESULT STDMETHODCALLTYPE CLiveExdiGdbSrvServer::GetContextEx()
in Exdi/exdigdbsrv/ExdiGdbSrv/LiveExdiGdbSrvServer.cpp
92 6 2
SimpleCharBuffer GdbSrvControllerImpl::ExecuteExdiGdbSrvMonitor()
in Exdi/exdigdbsrv/GdbSrvControllerLib/GdbSrvControllerLib.cpp
91 19 2
HRESULT STDMETHODCALLTYPE CLiveExdiGdbSrvServer::SetContextEx()
in Exdi/exdigdbsrv/ExdiGdbSrv/LiveExdiGdbSrvServer.cpp
87 11 2
inline HRESULT IsRenderer()
in TTDQueries/app-sample/dshowutil.h
84 17 2
bool GdbSrvControllerImpl::HandleAsynchronousCommandResponse()
in Exdi/exdigdbsrv/GdbSrvControllerLib/GdbSrvControllerLib.cpp
80 16 2
SimpleCharBuffer GdbSrvControllerImpl::PrintRegistersGroup()
in Exdi/exdigdbsrv/GdbSrvControllerLib/GdbSrvControllerLib.cpp
79 13 2
bool GdbSrvRspClient::GetRspSessionStatus()
in Exdi/exdigdbsrv/GdbSrvControllerLib/GdbSrvRspClient.cpp
78 16 2
bool XmlDataGdbServerRegisterFile::SetRegistersByTargetFile()
in Exdi/exdigdbsrv/GdbSrvControllerLib/XmlDataHelpers.cpp
78 14 2
inline HRESULT CreateRGBVideoType()
in TTDQueries/app-sample/dshowutil.h
78 18 5
SimpleCharBuffer GdbSrvControllerImpl::ReadMemory()
in Exdi/exdigdbsrv/GdbSrvControllerLib/GdbSrvControllerLib.cpp
77 18 3
HRESULT ConfigExdiGdbServerHelperImpl::ReadStream()
in Exdi/exdigdbsrv/GdbSrvControllerLib/cfgExdiGdbSrvHelper.cpp
76 18 0
function __defineSyntheticType()
in SyntheticTypes/SynTypes.js
70 8 2
LRESULT MainWindow::OnReceiveMessage()
in TTDQueries/app-sample/MainWindow.cpp
70 19 3
bool GdbSrvRspClient::ConfigRspSession()
in Exdi/exdigdbsrv/GdbSrvControllerLib/GdbSrvRspClient.cpp
65 15 2