microsoft / xlang
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 4,168 units with 40,835 lines of code in units (55.8% of code).
    • 26 very long units (4,304 lines of code)
    • 76 long units (5,133 lines of code)
    • 307 medium size units (9,386 lines of code)
    • 547 small units (7,881 lines of code)
    • 3,212 very small units (14,131 lines of code)
10% | 12% | 22% | 19% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp21% | 21% | 26% | 14% | 15%
h7% | 11% | 24% | 20% | 36%
hpp3% | 6% | 20% | 24% | 46%
js19% | 0% | 5% | 2% | 72%
cs0% | 0% | 35% | 52% | 11%
py0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
UndockedRegFreeWinRT/detours24% | 21% | 24% | 12% | 16%
tool/abi15% | 11% | 24% | 20% | 27%
tool/cppxlang7% | 15% | 25% | 18% | 33%
tool/python8% | 18% | 24% | 24% | 24%
scripts19% | 0% | 5% | 2% | 72%
UndockedRegFreeWinRT/UndockedRegFreeWinRT21% | 18% | 36% | 19% | 3%
library/impl7% | 5% | 21% | 14% | 51%
library2% | 7% | 20% | 23% | 45%
UndockedRegFreeWinRT/Catch3% | 6% | 20% | 24% | 46%
platform0% | 8% | 29% | 29% | 31%
UndockedRegFreeWinRT/EmbeddedManifestManagedTest0% | 0% | 36% | 55% | 7%
UndockedRegFreeWinRT/UndockedRegFreeWinRTManagedTest0% | 0% | 36% | 49% | 13%
UndockedRegFreeWinRT/EmbeddedTestComponent0% | 0% | 0% | 0% | 100%
UndockedRegFreeWinRT/TestComponent0% | 0% | 0% | 0% | 100%
platform/published0% | 0% | 0% | 0% | 100%
UndockedRegFreeWinRT/mwinrtact0% | 0% | 0% | 0% | 100%
platform/helpers0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
BOOL CImage::Write()
in src/UndockedRegFreeWinRT/detours/image.cpp
331 64 1
LONG WINAPI DetourAttachEx()
in src/UndockedRegFreeWinRT/detours/detours.cpp
288 36 5
BOOL CImage::Read()
in src/UndockedRegFreeWinRT/detours/image.cpp
250 45 1
void initialize()
in src/library/impl/meta_reader/database.h
229 59 0
LONG WINAPI DetourTransactionCommitEx()
in src/UndockedRegFreeWinRT/detours/detours.cpp
219 21 1
static BOOL UPDATE_IMPORTS_XX()
in src/UndockedRegFreeWinRT/detours/uimports.cpp
202 32 3
clara::Parser makeCommandLineParser()
in src/UndockedRegFreeWinRT/Catch/catch.hpp
184 24 1
184 24 1
int main()
in src/tool/abi/main.cpp
181 34 2
function initializeScript()
in src/scripts/mdExts.js
152 1 0
static void write_component_g_cpp()
in src/tool/cppxlang/component_writers.h
151 19 2
void write_method_functions()
in src/tool/python/code_writers.h
150 20 2
void write_pinterface_impl()
in src/tool/python/code_writers.h
142 13 2
function __MakeTableVisualizer()
in src/scripts/mdExts.js
140 18 1
static void write_component_g_h()
in src/tool/cppxlang/component_writers.h
139 11 2
BOOL CImage::EditImports()
in src/UndockedRegFreeWinRT/detours/image.cpp
138 32 5
HRESULT FindTypeInDirectory()
in src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/typeresolution.cpp
136 17 6
128 23 2
static void write_consume_extensions()
in src/tool/cppxlang/code_writers.h
128 15 2
static void write_delegate_definition()
in src/tool/cppxlang/code_writers.h
126 16 2