microsoft / Win2D-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 935 units with 22,334 lines of code in units (77.2% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (173 lines of code)
    • 6 medium complex units (352 lines of code)
    • 29 simple units (1,146 lines of code)
    • 898 very simple units (20,663 lines of code)
0% | <1% | 1% | 5% | 92%
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
cs0% | <1% | 1% | 4% | 92%
cpp0% | 0% | 0% | 28% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ExampleGallery0% | <1% | 1% | 5% | 92%
ExampleGallery/Direct3DInterop0% | 0% | 0% | 28% | 71%
ExampleGallery/Infrastructure0% | 0% | 0% | 5% | 94%
CoreWindowExample0% | 0% | 0% | 6% | 93%
CompositionExample0% | 0% | 0% | 0% | 100%
ExampleGallery/BackgroundTask0% | 0% | 0% | 0% | 100%
ExampleGallery/Effects0% | 0% | 0% | 0% | 100%
ExampleGallery/Particles0% | 0% | 0% | 0% | 100%
ExampleGallery/SpriteSheets0% | 0% | 0% | 0% | 100%
SimpleSample0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
private void CreateEffect()
in ExampleGallery/EffectsExample.xaml.cs
138 43 1
private static char GetPressedLetter()
in ExampleGallery/KeyboardInputExample.xaml.cs
35 27 1
List CreateGlyphRuns()
in ExampleGallery/CustomTextLayouts.xaml.cs
70 17 3
void EnsureResources()
in ExampleGallery/SubscriptSuperscript.xaml.cs
76 14 2
void Canvas_Draw()
in ExampleGallery/DpiExample.xaml.cs
41 13 2
private void Canvas_Draw()
in ExampleGallery/CustomTextLayouts.xaml.cs
55 12 2
public void DrawGlyphRun()
in ExampleGallery/TypographyExample.xaml.cs
74 12 13
public void Update()
in ExampleGallery/KeyboardInputExample.xaml.cs
36 11 0
private void ProcessPointerInput()
in ExampleGallery/GameOfLife.xaml.cs
26 10 1
private void canvasControl_Draw()
in ExampleGallery/SvgExample.xaml.cs
56 10 2
void Canvas_Draw()
in ExampleGallery/ArcOptions.xaml.cs
54 9 2
void AddDefaultPatch()
in ExampleGallery/GradientMeshExample.xaml.cs
32 9 1
static Rect CropCapturedBitmap()
in ExampleGallery/Infrastructure/ThumbnailGenerator.xaml.cs
25 9 2
Matrix3x2 GetDirectionTransform()
in ExampleGallery/TextDirectionControl.cs
35 9 1
void Canvas_Draw()
in ExampleGallery/CustomEffects.xaml.cs
45 8 2
void canvas_Draw()
in ExampleGallery/EffectRegionMapping.xaml.cs
64 8 2
async Task RunScenarios()
in ExampleGallery/SpriteBatchPerf.xaml.cs
42 8 0
private void Canvas_Draw()
in ExampleGallery/TextLayouts.xaml.cs
41 8 2
private CanvasTextLayout CreateTextLayout()
in ExampleGallery/TextOutlines.xaml.cs
46 8 3
public void MoveNext()
in ExampleGallery/CustomTextLayouts.xaml.cs
28 7 0