microsoft / clr-samples
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 224 units with 1,457 lines of code in units (55.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (166 lines of code)
    • 1 medium complex units (113 lines of code)
    • 2 simple units (38 lines of code)
    • 220 very simple units (1,140 lines of code)
0% | 11% | 7% | 2% | 78%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
cpp0% | 11% | 8% | 0% | 79%
h0% | 0% | 0% | 52% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ReJITEnterLeaveHooks0% | 17% | 12% | 2% | 68%
ELTProfiler0% | 0% | 0% | 3% | 96%
Most Complex Units
Top 20 most complex 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 STDMETHODCALLTYPE QueryInterface()
in ProfilingAPI/ELTProfiler/CorProfiler.h
19 10 2
HRESULT STDMETHODCALLTYPE QueryInterface()
in ProfilingAPI/ReJITEnterLeaveHooks/CorProfiler.h
19 10 2
HRESULT AddExitProbe()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
33 5 4
HRESULT STDMETHODCALLTYPE CorProfiler::Initialize()
in ProfilingAPI/ELTProfiler/CorProfiler.cpp
20 4 1
HRESULT ImportEH()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
25 4 2
HRESULT STDMETHODCALLTYPE ClassFactory::QueryInterface()
in ProfilingAPI/ELTProfiler/ClassFactory.cpp
11 3 2
HRESULT STDMETHODCALLTYPE ClassFactory::CreateInstance()
in ProfilingAPI/ELTProfiler/ClassFactory.cpp
14 3 3
HRESULT STDMETHODCALLTYPE ClassFactory::QueryInterface()
in ProfilingAPI/ReJITEnterLeaveHooks/ClassFactory.cpp
11 3 2
HRESULT STDMETHODCALLTYPE ClassFactory::CreateInstance()
in ProfilingAPI/ReJITEnterLeaveHooks/ClassFactory.cpp
14 3 3
LPBYTE AllocateILMemory()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
10 3 1
HRESULT AddProbe()
in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp
23 3 5
ULONG STDMETHODCALLTYPE ClassFactory::Release()
in ProfilingAPI/ELTProfiler/ClassFactory.cpp
9 2 0
HRESULT STDMETHODCALLTYPE CorProfiler::Shutdown()
in ProfilingAPI/ELTProfiler/CorProfiler.cpp
9 2 0
ULONG STDMETHODCALLTYPE Release()
in ProfilingAPI/ELTProfiler/CorProfiler.h
9 2 1
ULONG STDMETHODCALLTYPE ClassFactory::Release()
in ProfilingAPI/ReJITEnterLeaveHooks/ClassFactory.cpp
9 2 0
HRESULT STDMETHODCALLTYPE CorProfiler::Initialize()
in ProfilingAPI/ReJITEnterLeaveHooks/CorProfiler.cpp
13 2 1
HRESULT STDMETHODCALLTYPE CorProfiler::Shutdown()
in ProfilingAPI/ReJITEnterLeaveHooks/CorProfiler.cpp
9 2 0
ULONG STDMETHODCALLTYPE Release()
in ProfilingAPI/ReJITEnterLeaveHooks/CorProfiler.h
9 2 1