microsoft / MSIX-PackageSupportFramework
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 2,369 units with 27,289 lines of code in units (51.3% of code).
    • 24 very long units (4,617 lines of code)
    • 66 long units (4,492 lines of code)
    • 220 medium size units (6,949 lines of code)
    • 255 small units (3,649 lines of code)
    • 1,804 very small units (7,582 lines of code)
16% | 16% | 25% | 13% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp23% | 23% | 29% | 11% | 12%
cs49% | 19% | 19% | 8% | 2%
h5% | 9% | 22% | 16% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Detours25% | 23% | 24% | 11% | 15%
PsfShimMonitor49% | 19% | 19% | 8% | 2%
include/rapidjson13% | 11% | 25% | 14% | 34%
fixups/FileRedirectionFixup23% | 26% | 38% | 6% | 4%
fixups/RegLegacyFixups15% | 20% | 40% | 10% | 12%
PsfRuntime20% | 25% | 22% | 12% | 19%
include/wil0% | 8% | 14% | 16% | 60%
PsfLauncher0% | 22% | 51% | 16% | 10%
include0% | 0% | 32% | 26% | 40%
fixups/DynamicLibraryFixup0% | 0% | 80% | 5% | 14%
fixups/ElectronFixup0% | 0% | 30% | 54% | 14%
PsfRunDll0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void EnableKernelTrace()
in PsfShimMonitor/KernelTrace.cs
743 113 1
BOOL CImage::Write()
in Detours/image.cpp
337 64 1
LONG WINAPI DetourAttachEx()
in Detours/detours.cpp
288 36 5
BOOL CImage::Read()
in Detours/image.cpp
250 45 1
private bool ApplyFilterCategoryEventToEventItem()
in PsfShimMonitor/MainWindow.xaml.cs
239 113 1
void ParseNumber()
in include/rapidjson/reader.h
232 93 2
219 21 1
static path_redirect_info ShouldRedirectImpl()
in fixups/FileRedirectionFixup/PathRedirection.cpp
206 34 3
static BOOL UPDATE_IMPORTS_XX()
in Detours/uimports.cpp
202 32 3
REGSAM RegFixupSam()
in fixups/RegLegacyFixups/RegistryFixups.cpp
167 34 3
HANDLE __stdcall FindFirstFileExFixup()
in fixups/FileRedirectionFixup/FindFirstFileFixup.cpp
166 25 3
BOOL __stdcall FindNextFileFixup()
in fixups/FileRedirectionFixup/FindFirstFileFixup.cpp
164 28 2
147 1 2
BOOL WINAPI CreateProcessFixup()
in PsfRuntime/CreateProcessHook.cpp
142 21 10
BOOL CImage::EditImports()
in Detours/image.cpp
138 32 5
LONG WINAPI DetourDetach()
in Detours/detours.cpp
121 14 2
static BOOL UpdateFrom32To64()
in Detours/creatwth.cpp
118 14 4
private void SearchForString()
in PsfShimMonitor/MainWindow.xaml.cs
108 23 0
void Parse()
in include/rapidjson/internal/regex.h
107 37 1
private void Eventbgw_DoWork()
in PsfShimMonitor/MainWindow.xaml.cs
106 13 2