microsoft / Win2D
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 5,314 units with 53,964 lines of code in units (47.4% of code).
    • 1 very complex units (114 lines of code)
    • 3 complex units (309 lines of code)
    • 24 medium complex units (1,629 lines of code)
    • 103 simple units (3,732 lines of code)
    • 5,183 very simple units (48,180 lines of code)
<1% | <1% | 3% | 6% | 89%
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
cpp<1% | <1% | 1% | 7% | 89%
cs0% | 2% | 15% | 17% | 64%
h0% | 0% | <1% | 1% | 97%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
winrt/lib<1% | <1% | 2% | 6% | 90%
winrt/test.managed0% | 4% | 9% | 10% | 75%
tools/mock0% | 20% | 0% | 52% | 27%
tools/codegen0% | 0% | 36% | 21% | 42%
winrt/test.external0% | 0% | 1% | 3% | 95%
winrt/test.internal0% | 0% | 0% | 4% | 95%
tools/exportsample0% | 0% | 0% | 14% | 85%
tools/checkcode0% | 0% | 0% | 32% | 67%
winrt/inc0% | 0% | 0% | 5% | 94%
tools/shared0% | 0% | 0% | 20% | 79%
winrt/test.nativecomponent0% | 0% | 0% | 0% | 100%
winrt/published0% | 0% | 0% | 0% | 100%
winrt/dll0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
unsigned GetBytesPerBlock()
in winrt/lib/utils/DxgiUtilities.cpp
114 100 1
bool CanvasAnimatedControl::Tick()
in winrt/lib/xaml/CanvasAnimatedControl.cpp
139 36 2
object GetArbitraryTestValue()
in winrt/test.managed/EffectTests.cs
129 32 2
public static string GetIndirection()
in tools/mock/exe/Program.cs
41 27 1
unsigned GetBlockSize()
in winrt/lib/utils/DxgiUtilities.cpp
30 22 1
inline std::wstring ToString()
in winrt/test.external/Helpers.h
26 20 1
private static void WritePropertyImplementation()
in tools/codegen/exe/OutputEffectType.cs
62 19 3
ComPtr CanvasEffect::GetD2DProperty()
in winrt/lib/effects/CanvasEffect.cpp
64 18 2
public void PixelShaderEffect_BorderModeAccessors()
in winrt/test.managed/PixelShaderEffectTests.cs
41 18 0
void CanvasAnimatedControl::ChangedImpl()
in winrt/lib/xaml/CanvasAnimatedControl.cpp
73 17 0
RunWithDeviceFlags EnsureDeviceCreated()
in winrt/lib/xaml/RecreatableDeviceManager.impl.h
63 17 2
static object Box()
in winrt/test.managed/EffectTests.cs
106 17 2
static object Unbox()
in winrt/test.managed/EffectTests.cs
124 17 2
public static void OutputEffectIdl()
in tools/codegen/exe/OutputEffectType.cs
105 15 2
static string FormatPropertyValue()
in tools/codegen/exe/OutputEffectType.cs
62 15 2
private static void ResolveTypeNames()
in tools/codegen/exe/Effect.cs
82 14 1
public static void OutputEffectHeader()
in tools/codegen/exe/OutputEffectType.cs
91 14 2
private static List ParseD2DEffectsEnums()
in tools/codegen/exe/Effect.cs
61 13 2
public Struct()
in tools/codegen/exe/Struct.cs
51 13 5
static bool TryGetFillOpacityMaskParameters()
in winrt/lib/drawing/CanvasDrawingSession.cpp
32 12 5