microsoft / mu_plus
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 104 units with 2,065 lines of code in units (1.2% of code).
    • 1 very long units (131 lines of code)
    • 8 long units (579 lines of code)
    • 26 medium size units (746 lines of code)
    • 26 small units (390 lines of code)
    • 43 very small units (219 lines of code)
6% | 28% | 36% | 18% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c11% | 31% | 33% | 14% | 9%
py0% | 24% | 39% | 24% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
HidPkg100% | 0% | 0% | 0% | 0%
MsGraphicsPkg0% | 32% | 34% | 17% | 15%
UefiTestingPkg0% | 23% | 47% | 13% | 14%
PcBdsPkg0% | 57% | 14% | 19% | 8%
AdvLoggerPkg0% | 25% | 23% | 46% | 4%
DfciPkg0% | 47% | 37% | 14% | 0%
MsCorePkg0% | 0% | 88% | 0% | 11%
XmlSupportPkg0% | 0% | 83% | 0% | 16%
MfciPkg0% | 0% | 61% | 38% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
VOID ProcessKeyStroke()
in HidPkg/HidKeyboardDxe/HidKeyboard.c
131 28 3
VOID Ctor()
in MsGraphicsPkg/Library/SimpleUIToolKit/ListBox.c
100 8 11
def Parse()
in UefiTestingPkg/AuditTests/PagingAudit/Windows/PagingReportGenerator.py
97 38 1
def _InitializeLoggerInfo()
in AdvLoggerPkg/Application/DecodeUefiLog/DecodeUefiLog.py
76 8 3
EFI_STATUS SelectAndBootDevice()
in PcBdsPkg/MsBootPolicy/MsBootPolicy.c
74 12 2
BOOLEAN CompareDevicePathAgtB()
in PcBdsPkg/MsBootPolicy/MsBootPolicy.c
70 15 2
EFIAPI TimerTick()
in DfciPkg/Application/DfciMenu/DfciRequest.c
58 8 2
def main()
in UefiTestingPkg/AuditTests/UefiVarLockAudit/Windows/UefiVarAudit.py
53 14 0
DIALOG_THEME InitializeTheme()
in MsGraphicsPkg/Library/SwmDialogsLib/SemmUserAuthDialog.c
51 4 1
DIALOG_THEME InitializeTheme()
in MsGraphicsPkg/Library/SwmDialogsLib/PasswordDialog.c
49 2 1
def _GetNextFormattedLine()
in AdvLoggerPkg/Application/DecodeUefiLog/DecodeUefiLog.py
48 15 3
OUT UINT8()
in DfciPkg/IdentityAndAuthManager/CertSupport.c
46 9 1
BOOLEAN RtlRawXmlTokenizer_IsValidPubIdCharacter()
in XmlSupportPkg/Library/XmlTreeLib/fasterxml/xml_fasterxml.c
41 25 2
unsigned char _BitScanReverse()
in MsCorePkg/Library/MathLib/MathLib.c
38 4 2
VOID SortHandles()
in PcBdsPkg/MsBootPolicy/MsBootPolicy.c
35 7 2
def main()
in UefiTestingPkg/AuditTests/PagingAudit/Windows/PagingReportGenerator.py
34 8 0
static inline UINT16 bsr64()
in MsCorePkg/Library/MathLib/MathLib.c
31 5 1
def OutputHtmlReport()
in UefiTestingPkg/AuditTests/PagingAudit/Windows/PagingReportGenerator.py
28 10 3
def __init__()
in UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py
27 9 4
def sameAttributes()
in UefiTestingPkg/AuditTests/PagingAudit/Windows/MemoryRangeObjects.py
26 15 2