microsoft / MXDial-IoT-Sample
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 85 units with 1,029 lines of code in units (28.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (103 lines of code)
    • 3 simple units (103 lines of code)
    • 80 very simple units (823 lines of code)
0% | 0% | 10% | 10% | 79%
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
ino0% | 0% | 29% | 0% | 70%
js0% | 0% | 15% | 8% | 76%
cs0% | 0% | 0% | 9% | 90%
cpp0% | 0% | 0% | 36% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mxdevice/Device0% | 0% | 19% | 12% | 68%
frontend/mx/src0% | 0% | 15% | 9% | 75%
backend/MXApi/Services0% | 0% | 0% | 32% | 67%
backend/MXApi/Filters0% | 0% | 0% | 0% | 100%
backend/MXApi/Jobs0% | 0% | 0% | 0% | 100%
backend/MXApi/Controllers0% | 0% | 0% | 0% | 100%
backend/MXApi/Helpers0% | 0% | 0% | 0% | 100%
backend/MXApi/Resolvers0% | 0% | 0% | 0% | 100%
backend/MXApi/Models0% | 0% | 0% | 0% | 100%
backend/MXApi0% | 0% | 0% | 0% | 100%
frontend/common/containers0% | 0% | 0% | 0% | 100%
backend/MXApi/Config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
componentWillReceiveProps()
in frontend/mx/src/containers/app.js
48 14 1
ino
void loop()
in mxdevice/Device/MXDeviceDemo.ino
55 14 0
private async Task ReceiveMessagesFromDeviceAsync()
in backend/MXApi/Services/MessagingService.cs
41 6 2
componentWillReceiveProps()
in frontend/mx/src/containers/threshold-notifications.js
28 6 1
void parseTwinMessage()
in mxdevice/Device/utility.cpp
34 6 2
private static Tuple ExtractUserNameAndPassword()
in backend/MXApi/Filters/BasicAuthorizeFilter.cs
40 5 1
public Task AuthenticateAsync()
in backend/MXApi/Filters/BasicAuthorizeFilter.cs
27 4 2
public void ReadMessages()
in backend/MXApi/Services/MessagingService.cs
21 4 1
render()
in frontend/mx/src/components/trigger-overlay.js
24 4 0
componentDidMount()
in frontend/mx/src/containers/device-provider.js
15 4 0
ino
void setup()
in mxdevice/Device/MXDeviceDemo.ino
61 4 0
public static string Truncate()
in backend/MXApi/Helpers/Utilities.cs
5 3 2
public void Execute()
in backend/MXApi/Jobs/EventHubProcessingJob.cs
21 3 0
public async Task ExecuteAsync()
in backend/MXApi/Models/AuthenticationFailureResult.cs
12 3 1
componentWillReceiveProps()
in frontend/common/containers/modal.js
9 3 1
componentDidMount()
in frontend/mx/src/components/trigger-overlay.js
9 3 0
componentDidMount()
in frontend/mx/src/containers/app.js
9 3 0
getValue()
in frontend/mx/src/mock/events.js
6 3 0
ino
static int deviceMethodCallback()
in mxdevice/Device/MXDeviceDemo.ino
30 3 5
public async Task SendDeviceMessage()
in backend/MXApi/Controllers/MXController.cs
7 2 1