microsoft / WPF-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 3,130 units with 53,756 lines of code in units (42.7% of code).
    • 7 very complex units (1,416 lines of code)
    • 11 complex units (1,713 lines of code)
    • 147 medium complex units (13,443 lines of code)
    • 192 simple units (6,918 lines of code)
    • 2,773 very simple units (30,266 lines of code)
2% | 3% | 25% | 12% | 56%
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
cs2% | 3% | 25% | 11% | 56%
cpp0% | 2% | 19% | 31% | 47%
h0% | 0% | 0% | 0% | 100%
vb0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Documents10% | 3% | 18% | 12% | 55%
Sample Applications2% | 3% | 19% | 17% | 57%
Input and Commands14% | 0% | 6% | 7% | 70%
Graphics0% | 14% | 12% | 19% | 53%
Tools0% | 3% | 10% | 17% | 68%
Getting Started0% | 0% | 92% | 1% | 6%
Accessibility0% | 0% | 8% | 23% | 67%
Clipboard0% | 0% | 32% | 19% | 47%
Migration and Interoperability0% | 0% | 7% | 4% | 88%
Data Binding0% | 0% | 8% | 3% | 88%
Animation0% | 0% | 6% | 2% | 90%
Compatibility0% | 0% | 0% | 65% | 34%
PerMonitorDPI0% | 0% | 0% | 6% | 93%
Windows0% | 0% | 0% | 3% | 96%
Drag and Drop0% | 0% | 0% | 5% | 94%
Visual Layer0% | 0% | 0% | 0% | 100%
Elements0% | 0% | 0% | 0% | 100%
Application Management0% | 0% | 0% | 0% | 100%
Styles & Templates0% | 0% | 0% | 0% | 100%
Properties0% | 0% | 0% | 0% | 100%
Threading0% | 0% | 0% | 0% | 100%
Speech and Media0% | 0% | 0% | 0% | 100%
Globalization and Localization0% | 0% | 0% | 0% | 100%
Events0% | 0% | 0% | 0% | 100%
Resources0% | 0% | 0% | 0% | 100%
Element Tree0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public static SolidColorBrush ColorStringToBrushes()
in Documents/Fixed Documents/DocumentSerialization/Util.cs
388 244 1
public static string GetBrushesFromString()
in Documents/Fixed Documents/DocumentSerialization/Util.cs
145 142 1
private static void ApplyLocalProperties()
in Documents/Fixed Documents/DocumentSerialization/HtmlXmlConverter/htmltoxamlconverter.cs
215 65 3
private static void ApplyLocalProperties()
in Sample Applications/HtmlToXamlDemo/HtmlToXamlConverter.cs
218 65 3
internal static void GetElementPropertiesFromCssAttributes()
in Documents/Fixed Documents/DocumentSerialization/HtmlXmlConverter/htmlcssparser.cs
135 59 5
internal static void GetElementPropertiesFromCssAttributes()
in Sample Applications/HtmlToXamlDemo/HtmlCSSParser.cs
142 58 5
private void ExecuteCommand()
in Input and Commands/EditingCommands/MainWindow.cs
173 57 2
private static XmlNode AddBlock()
in Sample Applications/HtmlToXamlDemo/HtmlToXamlConverter.cs
90 46 5
private static XmlNode AddBlock()
in Documents/Fixed Documents/DocumentSerialization/HtmlXmlConverter/htmltoxamlconverter.cs
85 45 5
private static Hashtable GetElementProperties()
in Documents/Fixed Documents/DocumentSerialization/HtmlXmlConverter/htmltoxamlconverter.cs
114 38 5
private static Hashtable GetElementProperties()
in Sample Applications/HtmlToXamlDemo/HtmlToXamlConverter.cs
118 38 5
public void PerformOperation()
in Graphics/Vector/MainWindow.cs
382 35 2
private static void WriteFormattingProperties()
in Documents/Fixed Documents/DocumentSerialization/HtmlXmlConverter/htmlfromxamlconverter.cs
103 34 3
private static void WriteFormattingProperties()
in Sample Applications/HtmlToXamlDemo/HtmlFromXamlConverter.cs
104 34 3
public void PerformOperation()
in Graphics/Matrix/MainWindow.cs
362 33 2
internal string CheckAndSetDefault()
in Tools/LocBaml/LocBaml.cs
161 33 0
private void ok_Click()
in Sample Applications/StickyNotesDemo/Dialog.cs
128 31 2
UINT GetScanlineStride()
in Graphics/AITCodec/cpp/utility.cpp
66 29 2
private static void WriteElement()
in Documents/Fixed Documents/DocumentSerialization/HtmlXmlConverter/htmlfromxamlconverter.cs
80 25 3
private static void WriteElement()
in Sample Applications/HtmlToXamlDemo/HtmlFromXamlConverter.cs
82 25 3