microsoft / clr-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 224 units with 1,457 lines of code in units (55.7% of code).
    • 2 very long units (279 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (81 lines of code)
    • 15 small units (226 lines of code)
    • 204 very small units (871 lines of code)
19% | 0% | 5% | 15% | 59%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp20% | 0% | 5% | 13% | 60%
h0% | 0% | 0% | 52% | 47%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ReJITEnterLeaveHooks29% | 0% | 8% | 12% | 48%
ELTProfiler0% | 0% | 0% | 20% | 79%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
HRESULT Export()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
166 31 0
HRESULT ImportIL()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
113 22 1
HRESULT AddExitProbe()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
33 5 4
HRESULT ImportEH()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
25 4 2
HRESULT AddProbe()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
23 3 5
HRESULT STDMETHODCALLTYPE CorProfiler::Initialize()
in ProfilingAPI/ELTProfiler/CorProfiler.cpp
20 4 1
HRESULT STDMETHODCALLTYPE QueryInterface()
in ProfilingAPI/ELTProfiler/CorProfiler.h
19 10 2
HRESULT STDMETHODCALLTYPE QueryInterface()
in ProfilingAPI/ReJITEnterLeaveHooks/CorProfiler.h
19 10 2
HRESULT RewriteIL()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
19 1 8
void __declspec()
in ProfilingAPI/ELTProfiler/CorProfiler.cpp
15 1 1
void __declspec()
in ProfilingAPI/ELTProfiler/CorProfiler.cpp
15 1 1
void __declspec()
in ProfilingAPI/ELTProfiler/CorProfiler.cpp
15 1 1
HRESULT STDMETHODCALLTYPE CorProfiler::JITCompilationStarted()
in ProfilingAPI/ReJITEnterLeaveHooks/CorProfiler.cpp
15 1 2
HRESULT STDMETHODCALLTYPE ClassFactory::CreateInstance()
in ProfilingAPI/ELTProfiler/ClassFactory.cpp
14 3 3
HRESULT STDMETHODCALLTYPE ClassFactory::CreateInstance()
in ProfilingAPI/ReJITEnterLeaveHooks/ClassFactory.cpp
14 3 3
HRESULT Import()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
14 1 0
HRESULT STDMETHODCALLTYPE CorProfiler::Initialize()
in ProfilingAPI/ReJITEnterLeaveHooks/CorProfiler.cpp
13 2 1
HRESULT SetILFunctionBody()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
12 2 2
HRESULT STDMETHODCALLTYPE ClassFactory::QueryInterface()
in ProfilingAPI/ELTProfiler/ClassFactory.cpp
11 3 2
HRESULT STDMETHODCALLTYPE ClassFactory::QueryInterface()
in ProfilingAPI/ReJITEnterLeaveHooks/ClassFactory.cpp
11 3 2