microsoft / AISchoolTutorials
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 1,795 units with 22,241 lines of code in units (50.3% of code).
    • 3 very complex units (607 lines of code)
    • 7 complex units (555 lines of code)
    • 63 medium complex units (2,679 lines of code)
    • 146 simple units (4,037 lines of code)
    • 1,576 very simple units (14,363 lines of code)
2% | 2% | 12% | 18% | 64%
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
js7% | 6% | 18% | 24% | 43%
cs0% | 0% | 6% | 14% | 79%
py0% | 0% | 19% | 12% | 68%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sketch2code/Sketch2Code.Web6% | 6% | 17% | 23% | 45%
snipinsights/windows0% | 0% | 6% | 14% | 78%
pix2story/source0% | 0% | 16% | 14% | 68%
style-transfer/Training0% | 0% | 34% | 0% | 65%
sketch2code/Sketch2Code.Core0% | 0% | 3% | 28% | 68%
sketch2code/Import0% | 0% | 0% | 100% | 0%
MLNETCrashCourse/00.CompleteExamples0% | 0% | 0% | 0% | 100%
style-transfer/WebApp0% | 0% | 0% | 0% | 100%
sketch2code/Sketch2Code.AI0% | 0% | 0% | 0% | 100%
MLNETCrashCourse/05.LogisticRegression0% | 0% | 0% | 0% | 100%
sketch2code/Sketch2Code.Api0% | 0% | 0% | 0% | 100%
MLNETCrashCourse/04.PolynomialRegression0% | 0% | 0% | 0% | 100%
MLNETCrashCourse/03.MultipleLinearRegression0% | 0% | 0% | 0% | 100%
MLNETCrashCourse/01.IntroductionToMLNET0% | 0% | 0% | 0% | 100%
MLNETCrashCourse/02.LinearRegression0% | 0% | 0% | 0% | 100%
MLNETCrashCourse/06.SupportVectorMachines0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
270 78 0
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
173 63 0
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
164 54 0
function flip()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
57 41 2
function flip()
in sketch2code/Sketch2Code.Web/Scripts/esm/popper.js
57 41 2
function flip()
in sketch2code/Sketch2Code.Web/Scripts/popper.js
57 41 2
function flip()
in sketch2code/Sketch2Code.Web/Scripts/umd/popper.js
57 41 2
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
113 40 0
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
104 28 0
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
110 28 0
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
105 22 0
public async Task DeleteAsync()
in snipinsights/windows/SnipInsight/AppManager.cs
110 22 3
private async Task GetLUISInsights()
in snipinsights/windows/SnipInsight/AIServices/AIViewModels/OCRViewModel.cs
73 21 1
def main()
in style-transfer/Training/StyleTransferTraining/src/train.py
111 21 0
public static bool IsValidPrimaryKey()
in snipinsights/windows/SnipInsight/Util/KeyCombo.cs
28 20 1
private static bool IsOemKey()
in snipinsights/windows/SnipInsight/Util/KeyCombo.cs
27 20 1
function()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
46 16 0
(function (global, factory)()
in sketch2code/Sketch2Code.Web/Scripts/bootstrap.bundle.js
97 15 2
public override void OnApplyTemplate()
in snipinsights/windows/SnipInsight/Controls/Ariadne/AriModernWindow.cs
40 15 0
public IntPtr GetTopElement()
in snipinsights/windows/SnipInsight/ImageCapture/SmartBoundaryDetection.cs
45 14 2