microsoft / Windows-universal-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 6,853 units with 74,422 lines of code in units (47.0% of code).
    • 2 very complex units (219 lines of code)
    • 3 complex units (298 lines of code)
    • 111 medium complex units (5,273 lines of code)
    • 403 simple units (11,385 lines of code)
    • 6,334 very simple units (57,247 lines of code)
<1% | <1% | 7% | 15% | 76%
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
js<1% | <1% | 6% | 13% | 78%
cpp0% | 1% | 9% | 25% | 63%
cs0% | 0% | 6% | 9% | 83%
vb0% | 0% | 0% | 28% | 71%
h0% | 0% | 0% | 5% | 94%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
archived/SharedContent1% | 1% | 10% | 17% | 70%
SharedContent/cpp0% | 4% | 11% | 25% | 58%
archived/SpeechRecognitionAndSynthesis0% | 0% | 19% | 13% | 67%
archived/VoIP0% | 0% | 15% | 20% | 64%
archived/SimpleImaging0% | 0% | 24% | 14% | 61%
archived/Store0% | 0% | 40% | 3% | 56%
archived/Geolocation0% | 0% | 4% | 23% | 71%
SharedContent/cs0% | 0% | 11% | 5% | 83%
archived/AppServices0% | 0% | 32% | 38% | 28%
archived/OCR0% | 0% | 27% | 24% | 48%
archived/TextSuggestion0% | 0% | 43% | 19% | 36%
archived/ShareTarget0% | 0% | 35% | 0% | 64%
archived/TextSegmentation0% | 0% | 52% | 27% | 20%
archived/HttpClient0% | 0% | 5% | 30% | 64%
archived/WebAuthenticationBroker0% | 0% | 17% | 36% | 46%
archived/PhoneCall0% | 0% | 10% | 14% | 75%
archived/StreamSocket0% | 0% | 20% | 16% | 63%
archived/Clipboard0% | 0% | 7% | 24% | 67%
archived/ShareSource0% | 0% | 12% | 29% | 57%
archived/CortanaVoiceCommand0% | 0% | 12% | 9% | 78%
archived/AllJoyn0% | 0% | 5% | 6% | 88%
archived/CredentialPicker0% | 0% | 42% | 24% | 33%
archived/AnimationMetrics0% | 0% | 75% | 0% | 24%
archived/DatagramSocket0% | 0% | 12% | 19% | 68%
archived/SmartCard0% | 0% | 14% | 3% | 82%
archived/LineDisplay0% | 0% | 7% | 22% | 70%
archived/Calendar0% | 0% | 22% | 0% | 77%
archived/SystemMediaTransportControls0% | 0% | 17% | 25% | 56%
archived/CustomUsbDeviceAccess0% | 0% | 2% | 15% | 81%
archived/CustomSerialDeviceAccess0% | 0% | 3% | 13% | 82%
archived/NumberFormatting0% | 0% | 9% | 0% | 90%
archived/PdfDocument0% | 0% | 35% | 31% | 33%
archived/PasswordVault0% | 0% | 25% | 39% | 35%
archived/FileThumbnails0% | 0% | 10% | 20% | 69%
archived/ContextMenu0% | 0% | 34% | 0% | 65%
archived/Ink0% | 0% | 3% | 4% | 92%
archived/VersionAdaptiveCode0% | 0% | 16% | 0% | 83%
archived/BarcodeScanner0% | 0% | 3% | 6% | 90%
archived/ProximitySensor0% | 0% | 7% | 24% | 68%
archived/DeviceEnumerationAndPairing0% | 0% | 0% | 26% | 73%
archived/BackgroundTransfer0% | 0% | 0% | 19% | 80%
archived/BasicFaceDetection0% | 0% | 0% | 33% | 66%
archived/Pedometer0% | 0% | 0% | 44% | 55%
archived/CameraProfile0% | 0% | 0% | 49% | 50%
archived/Logging0% | 0% | 0% | 16% | 83%
archived/WiFiDirect0% | 0% | 0% | 34% | 65%
archived/CameraFaceDetection0% | 0% | 0% | 20% | 79%
archived/XmlDocument0% | 0% | 0% | 32% | 67%
archived/UserInfo0% | 0% | 0% | 27% | 72%
archived/CameraVideoStabilization0% | 0% | 0% | 18% | 81%
archived/SimpleCommunication0% | 0% | 0% | 12% | 87%
archived/ActivitySensor0% | 0% | 0% | 26% | 73%
archived/MediaTranscoding0% | 0% | 0% | 12% | 87%
archived/Compass0% | 0% | 0% | 26% | 73%
archived/Inclinometer0% | 0% | 0% | 25% | 74%
archived/FileAccess0% | 0% | 0% | 17% | 82%
archived/PosPrinter0% | 0% | 0% | 13% | 86%
archived/IndexedDB0% | 0% | 0% | 17% | 82%
archived/FilePicker0% | 0% | 0% | 29% | 70%
archived/Unicode0% | 0% | 0% | 60% | 39%
archived/Compression0% | 0% | 0% | 15% | 84%
archived/CustomCapability0% | 0% | 0% | 7% | 92%
archived/CameraAdvancedCapture0% | 0% | 0% | 12% | 87%
archived/SimpleOrientationSensor0% | 0% | 0% | 44% | 55%
archived/DeviceLockdownAzureLogin0% | 0% | 0% | 36% | 63%
archived/BasicFaceTracking0% | 0% | 0% | 15% | 84%
archived/BluetoothAdvertisement0% | 0% | 0% | 12% | 87%
archived/UserDataAccountManager0% | 0% | 0% | 28% | 71%
archived/FeedReader0% | 0% | 0% | 6% | 93%
archived/LanguageFont0% | 0% | 0% | 8% | 91%
archived/ContentIndexer0% | 0% | 0% | 7% | 92%
archived/UserConsentVerifier0% | 0% | 0% | 56% | 43%
archived/WebSocket0% | 0% | 0% | 5% | 94%
archived/CommunicationBlockAndFilter0% | 0% | 0% | 14% | 85%
archived/MediaEditing0% | 0% | 0% | 11% | 88%
archived/XamlMasterDetail0% | 0% | 0% | 12% | 87%
archived/Playlists0% | 0% | 0% | 13% | 86%
archived/FullScreenMode0% | 0% | 0% | 28% | 71%
archived/CashDrawer0% | 0% | 0% | 6% | 93%
archived/CameraStarterKit0% | 0% | 0% | 4% | 95%
archived/MsBlobBuilder0% | 0% | 0% | 4% | 95%
archived/JapanesePhoneticAnalysis0% | 0% | 0% | 52% | 47%
archived/ContactCards0% | 0% | 0% | 10% | 89%
archived/PackagedContent0% | 0% | 0% | 18% | 81%
archived/DisplayOrientation0% | 0% | 0% | 22% | 77%
archived/JumpList0% | 0% | 0% | 9% | 90%
archived/Package0% | 0% | 0% | 14% | 85%
archived/OrientationSensor0% | 0% | 0% | 4% | 95%
archived/TitleBar0% | 0% | 0% | 5% | 94%
archived/WebView0% | 0% | 0% | 1% | 98%
archived/AudioCategory0% | 0% | 0% | 0% | 100%
archived/AnimationLibrary0% | 0% | 0% | 0% | 100%
archived/Notifications0% | 0% | 0% | 0% | 100%
archived/PlayReady0% | 0% | 0% | 0% | 100%
archived/CameraResolution0% | 0% | 0% | 0% | 100%
archived/Accelerometer0% | 0% | 0% | 0% | 100%
archived/DateTimeFormatting0% | 0% | 0% | 0% | 100%
archived/CameraGetPreviewFrame0% | 0% | 0% | 0% | 100%
archived/WebWorkers0% | 0% | 0% | 0% | 100%
archived/ApplicationResources0% | 0% | 0% | 0% | 100%
archived/FolderEnumeration0% | 0% | 0% | 0% | 100%
archived/LampDevice0% | 0% | 0% | 0% | 100%
archived/Advertising0% | 0% | 0% | 0% | 100%
archived/MagneticStripeReader0% | 0% | 0% | 0% | 100%
archived/Gyrometer0% | 0% | 0% | 0% | 100%
archived/Projection0% | 0% | 0% | 0% | 100%
archived/BackgroundMediaPlayback0% | 0% | 0% | 0% | 100%
archived/HtmlFormValidation0% | 0% | 0% | 0% | 100%
SharedContent/cppwinrt0% | 0% | 0% | 0% | 100%
archived/CustomSensors0% | 0% | 0% | 0% | 100%
archived/UserCertificateStore0% | 0% | 0% | 0% | 100%
archived/IoT-GPIO0% | 0% | 0% | 0% | 100%
archived/LightSensor0% | 0% | 0% | 0% | 100%
archived/SemanticTextQuery0% | 0% | 0% | 0% | 100%
archived/DataReaderWriter0% | 0% | 0% | 0% | 100%
archived/LibraryManagement0% | 0% | 0% | 0% | 100%
archived/LinguisticServices0% | 0% | 0% | 0% | 100%
archived/CallerID0% | 0% | 0% | 0% | 100%
archived/ContactPicker0% | 0% | 0% | 0% | 100%
archived/Printing0% | 0% | 0% | 0% | 100%
archived/VideoPlayback0% | 0% | 0% | 0% | 100%
archived/RelativeInclinometer0% | 0% | 0% | 0% | 100%
archived/IoT-SPI0% | 0% | 0% | 0% | 100%
archived/TouchKeyboardTextInput0% | 0% | 0% | 0% | 100%
archived/Altimeter0% | 0% | 0% | 0% | 100%
archived/Barometer0% | 0% | 0% | 0% | 100%
archived/GlobalizationPreferences0% | 0% | 0% | 0% | 100%
archived/MessageDialog0% | 0% | 0% | 0% | 100%
archived/DpiScaling0% | 0% | 0% | 0% | 100%
archived/Geotag0% | 0% | 0% | 0% | 100%
archived/RadioManager0% | 0% | 0% | 0% | 100%
SharedContent/vb0% | 0% | 0% | 0% | 100%
archived/ResizeAppView0% | 0% | 0% | 0% | 100%
archived/TouchKeyboard0% | 0% | 0% | 0% | 100%
archived/IoT-I2C0% | 0% | 0% | 0% | 100%
SharedContent/Templates0% | 0% | 0% | 0% | 100%
archived/FileSearch0% | 0% | 0% | 0% | 100%
archived/UserSelection0% | 0% | 0% | 0% | 100%
archived/Personalization0% | 0% | 0% | 0% | 100%
archived/DisablingScreenCapture0% | 0% | 0% | 0% | 100%
archived/ClientDeviceInformation0% | 0% | 0% | 0% | 100%
archived/UserInteractionMode0% | 0% | 0% | 0% | 100%
archived/EfficientAnimations0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
79 73 1
oneTimeTextBindingAnalyze: function()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
140 70 1
function reservedWordLookup()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
105 49 1
void MoveLookController::OnPointerPressed()
in SharedContent/cpp/GameContent/MoveLookController.cpp
122 34 2
_keyDownHandler: function _KeyboardBehavior_keyDownHandler()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
71 30 1
function declarativeBindImpl()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
57 25 6
void MoveLookController::UpdatePollingDevices()
in SharedContent/cpp/GameContent/MoveLookController.cpp
99 24 0
function saveHandler()
in archived/SimpleImaging/js/js/scenario1.js
79 24 0
function handleRecognitionResult()
in archived/SpeechRecognitionAndSynthesis/js/js/scenario10_ContinuousRecognitionSRGSGrammar.js
52 21 1
function handleRecognitionResult()
in archived/SpeechRecognitionAndSynthesis/js/js/scenario7_SRGSConstraint.js
52 21 1
function run()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
73 20 1
function calculateScore()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
80 20 5
setTimeout()
in archived/AllJoyn/ProducerExperiences/js/js/scenario2.js
69 19 1
function launchCredPicker()
in archived/CredentialPicker/js/js/scenario3.js
62 19 0
async function newWindowButton_click()
in archived/LineDisplay/js/js/scenario3-usingWindows.js
54 19 0
function fatalErrorHandler()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
14 19 1
private void updateCellularInformation()
in archived/PhoneCall/cs/Helpers/CallingInfo.cs
85 18 0
_hasCursorKeysBehaviors: function Utilities_hasCursorKeysBehaviors()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
24 18 1
case isWhitespace()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
19 18 1
function readWhitespace()
in archived/SharedContent/js/Microsoft.WinJS/js/base.js
27 18 3