microsoft / WhatTheHack
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,912 units with 21,910 lines of code in units (22.4% of code).
    • 5 very complex units (841 lines of code)
    • 7 complex units (685 lines of code)
    • 29 medium complex units (1,334 lines of code)
    • 117 simple units (3,384 lines of code)
    • 1,754 very simple units (15,666 lines of code)
3% | 3% | 6% | 15% | 71%
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
js10% | 6% | 9% | 19% | 54%
py0% | 25% | 14% | 20% | 39%
cs0% | 0% | 3% | 12% | 83%
scala0% | 0% | 0% | 58% | 41%
csx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
009-MicroservicesInAzure12% | 8% | 11% | 7% | 60%
006-AppModernization7% | 0% | 0% | 5% | 86%
001-IntroToKubernetes0% | 5% | 7% | 25% | 61%
039-AKSEnterpriseGrade0% | 26% | 14% | 21% | 37%
002-IntroToAzureAI0% | 0% | 8% | 22% | 69%
021-IdentityForApps0% | 0% | 10% | 16% | 73%
047-TrafficControlWithDapr0% | 0% | 10% | 7% | 81%
017-FrontDoor0% | 0% | 0% | 40% | 59%
003-DrivingMissData0% | 0% | 0% | 51% | 48%
044-DevOpswithGithubActions0% | 0% | 0% | 15% | 84%
016-AppMigration0% | 0% | 0% | 14% | 85%
005-RockPaperScissorsBoom0% | 0% | 0% | 7% | 92%
015-Serverless0% | 0% | 0% | 8% | 91%
027-FHIRPoweredHealthcare0% | 0% | 0% | 13% | 86%
030-ConversationalAI0% | 0% | 0% | 0% | 100%
031-DevOpsWithGitHub0% | 0% | 0% | 0% | 100%
010-AzureDevOps0% | 0% | 0% | 0% | 100%
014-OSSDevOps0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
272 78 0
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
178 66 0
113 62 1
var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName()
in 006-AppModernization/Student/Resources/OnPremApp/IaaS2PaaSWeb/PartsUnlimitedWebsite/Scripts/respond.matchmedia.addListener.js
113 62 1
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
165 56 0
def send_sql_query()
in 039-AKSEnterpriseGrade/Student/Resources/api/sql_api.py
135 45 7
function flip()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
57 41 2
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
128 40 0
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
106 28 0
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
111 28 0
function minMaxValidatorFactory()
in 001-IntroToKubernetes/Student/Resources/Challenge 1/content-web/public/js/knockout.validation.js
74 26 1
function minMaxValidatorFactory()
in 001-IntroToKubernetes/Student/Resources/Challenge 7/content-web-v2/public/js/knockout.validation.js
74 26 1
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
103 22 0
public int CalculateFine()
in 047-TrafficControlWithDapr/Student/Resources/FineCollectionService/DomainServices/HardCodedFineCalculator.cs
47 18 2
function traverseGraph()
in 001-IntroToKubernetes/Student/Resources/Challenge 1/content-web/public/js/knockout.validation.js
33 17 3
function traverseGraph()
in 001-IntroToKubernetes/Student/Resources/Challenge 7/content-web-v2/public/js/knockout.validation.js
33 17 3
function()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
46 16 0
(function (global, factory)()
in 009-MicroservicesInAzure/Coach/Solutions/Code/Host.MVC.Core/wwwroot/lib/bootstrap/js/bootstrap.bundle.js
97 15 2
public async Task ContinueTopic()
in 002-IntroToAzureAI/Coach/Solutions/Challenge-2.2-Building-Bots/Code/FinishedPictureBot-Part3/PictureBot/PictureBot/Topics/RootTopic.cs
71 14 1
public async Task ContinueTopic()
in 002-IntroToAzureAI/Coach/Solutions/Challenge-2.2-Building-Bots/Code/FinishedPictureBot-Part4/PictureBot/PictureBot/Topics/RootTopic.cs
71 14 1