microsoft / BotFramework-BlogSamples
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 484 units with 5,964 lines of code in units (48.9% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (205 lines of code)
    • 7 medium complex units (392 lines of code)
    • 31 simple units (912 lines of code)
    • 444 very simple units (4,455 lines of code)
0% | 3% | 6% | 15% | 74%
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% | 4% | 6% | 13% | 76%
js0% | 0% | 8% | 23% | 68%
ts0% | 0% | 0% | 38% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
blog-samples/CSharp0% | 6% | 7% | 10% | 76%
SDKV4-Samples/dotnet_core0% | 0% | 7% | 21% | 71%
SDKV4-Samples/js0% | 0% | 12% | 28% | 58%
blog-samples/Node0% | 0% | 21% | 0% | 78%
StackOverflow-Bot/DialogAnalyzerFunc0% | 0% | 0% | 20% | 79%
docs-samples/v3Node0% | 0% | 0% | 73% | 26%
docs-samples/V40% | 0% | 0% | 41% | 58%
docs-samples/CSharp0% | 0% | 0% | 10% | 90%
docs-samples/Node0% | 0% | 0% | 0% | 100%
StackOverflow-Bot/StackBot0% | 0% | 0% | 0% | 100%
StackOverflow-Bot/StackCode0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public static async Task DoExport()
in blog-samples/CSharp/BotStateExport/BotStateExport/BotStateExport/Program.cs
173 31 1
private TriviaCategory GetCategoryValue()
in blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/TriviaDialog.cs
32 26 1
private async Task Trivia_ProcessAnswer()
in blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/TriviaDialog.cs
119 24 3
public async Task OnTurnAsync()
in SDKV4-Samples/dotnet_core/DialogInterruptionsBot/DialogInterruptionsBot.cs
70 14 2
private async void OnConversationUpdated()
in blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/MainPage.xaml.cs
72 14 2
static async fillOutUserProfile()
in SDKV4-Samples/js/PromptUsersForInput/bot.js
51 13 3
private static int ResolveOrdinalReference()
in blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/TriviaDialog.cs
19 13 1
internal static SqlBotDataEntity GetSqlBotDataEntity()
in blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/SqlStateService/SqlBotDataEntity.cs
27 11 3
yield takeEvery()
in blog-samples/Node/Blog-Redux-Bot/redux/sagas/default.js
34 11 2
public async Task OnTurnAsync()
in SDKV4-Samples/dotnet_core/ComplexDialogBot/ComplexDialogBot.cs
44 10 2
async onTurn()
in SDKV4-Samples/js/complexDialogBot/bot.js
32 10 1
public static async Task Run()
in StackOverflow-Bot/DialogAnalyzerFunc/AnalyzeDialog.cs
56 10 3
private async Task HandleSystemMessage()
in blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/Controllers/MessagesController.cs
32 9 1
function loadSession()
in docs-samples/v3Node/startNewDialog/botadapter.js
51 9 3
private static async Task FillOutUserProfileAsync()
in SDKV4-Samples/dotnet_core/PromptUsersForInput/CustomPromptBot.cs
56 8 3
private static bool ValidateDate()
in SDKV4-Samples/dotnet_core/PromptUsersForInput/CustomPromptBot.cs
33 8 3
async onTurn()
in SDKV4-Samples/js/DialogPromptBot/bot.js
35 8 1
function SaveEntities()
in docs-samples/V4/JS/contosocafebot-luis-dialogs/lib/luisbot.js
37 8 2
async function SaveEntities()
in docs-samples/V4/JS/contosocafebot-luis-dialogs/src/luisbot.ts
35 8 2
static validateAge()
in SDKV4-Samples/js/PromptUsersForInput/bot.js
22 7 1