microsoft / CLRInstrumentationEngine
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,105 units with 32,080 lines of code in units (40.4% of code).
    • 17 very long units (3,074 lines of code)
    • 80 long units (5,194 lines of code)
    • 303 medium size units (9,613 lines of code)
    • 460 small units (6,727 lines of code)
    • 1,245 very small units (7,472 lines of code)
9% | 16% | 29% | 20% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp8% | 19% | 30% | 22% | 19%
h9% | 11% | 29% | 21% | 28%
cs39% | 12% | 29% | 1% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/InstrumentationEngine16% | 18% | 27% | 20% | 17%
src/Extensions.Base.Api37% | 0% | 40% | 0% | 22%
src/InstrumentationEngine.Attach52% | 24% | 14% | 0% | 8%
inc/clr8% | 4% | 60% | 18% | 7%
src/Common.Lib0% | 37% | 40% | 13% | 7%
src/ExtensionsCommon0% | 23% | 37% | 14% | 24%
src/InstrumentationEngine.Lib0% | 22% | 29% | 22% | 26%
src/unix0% | 4% | 27% | 27% | 40%
src/Extensions.BaseLib0% | 44% | 29% | 17% | 8%
src/InstrumentationEngine.ProfilerProxy0% | 27% | 56% | 15% | 0%
build/Tasks0% | 100% | 0% | 0% | 0%
src/Common.Headers0% | 0% | 0% | 42% | 57%
src/InstrumentationEngine.ProfilerProxy.Lib0% | 0% | 0% | 31% | 68%
src/InstrumentationEngine.XdtExtensions0% | 0% | 0% | 76% | 23%
src/TestHostExtension0% | 0% | 0% | 0% | 100%
src/Extensions.Base0% | 0% | 0% | 0% | 100%
src/InstrumentationEngine.Api0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
class __declspec()
in src/InstrumentationEngine/ProfilerManager.h
612 14 1
public static void ApplicationInsights_RemoveCallbacks()
in src/Extensions.Base.Api/PublicContract.cs
244 29 2
242 53 4
203 19 2
private static int Attach()
in src/InstrumentationEngine.Attach/CommandHandler/AttachCommandHandler.cs
189 27 5
166 16 1
HRESULT MicrosoftInstrumentationEngine::AssemblyInjector::ImportTypeDef()
in src/InstrumentationEngine/AssemblyInjector.cpp
161 20 2
class __declspec()
in src/InstrumentationEngine/MethodInfo.h
149 1 1
146 9 0
class __declspec()
in src/InstrumentationEngine/ModuleInfo.h
144 2 1
class __declspec()
in src/InstrumentationEngine/Instruction.h
140 5 1
123 29 1
DWORD WINAPI CProfilerManager::ParseAttachConfigurationThreadProc()
in src/InstrumentationEngine/ProfilerManager.cpp
121 18 1
HRESULT GetCLRRuntimeInfoHelper()
in inc/clr/extra/LegacyActivationShimUtil.h
111 14 4
111 12 2
HRESULT CProfilerManager::AddRawProfilerHook()
in src/InstrumentationEngine/ProfilerManager.cpp
109 16 1
103 9 6
HRESULT MicrosoftInstrumentationEngine::AssemblyInjector::ConvertILCode()
in src/InstrumentationEngine/AssemblyInjector.cpp
100 30 1
HRESULT CXmlDocWrapper::Load()
in src/Common.Lib/XmlDocWrapper.cpp
97 13 2
HRESULT CConfigurationLoaderHelper::ProcessInstrumentationMethodNode()
in src/InstrumentationEngine.Lib/ConfigurationLoader.cpp
96 18 3