aws-samples / alexa-web-information-service-api-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 101 units with 1,382 lines of code in units (67.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (93 lines of code)
    • 2 simple units (59 lines of code)
    • 97 very simple units (1,230 lines of code)
0% | 0% | 6% | 4% | 89%
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
java0% | 0% | 8% | 4% | 86%
py0% | 0% | 38% | 0% | 61%
cs0% | 0% | 0% | 16% | 83%
php0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
pl0% | 0% | 0% | 0% | 100%
rb0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
java/src0% | 0% | 9% | 5% | 85%
python0% | 0% | 38% | 0% | 61%
dotnet0% | 0% | 0% | 19% | 80%
php0% | 0% | 0% | 0% | 100%
legacy/php0% | 0% | 0% | 0% | 100%
javascript0% | 0% | 0% | 0% | 100%
legacy/java0% | 0% | 0% | 0% | 100%
legacy/perl0% | 0% | 0% | 0% | 100%
legacy/dotnet0% | 0% | 0% | 0% | 100%
legacy/ruby0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def parse_options()
in python/awis.py
35 19 1
String httpPost()
in java/src/main/java/com/alexa/awisapi/AuthHttpClient.java
58 14 2
private void deriveKey()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
32 7 4
27 7 0
public static void main()
in java/src/main/java/com/alexa/awisapi/AWIS.java
17 5 1
private static boolean ValidateUser()
in java/src/main/java/com/alexa/awisapi/AWIS.java
26 5 1
19 5 0
private void init()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
20 4 2
public CognitoHelper()
in java/src/main/java/com/alexa/awisapi/CognitoHelper.java
23 4 0
private static void SerializeCredentials()
in java/src/main/java/com/alexa/awisapi/AWIS.java
19 4 1
private static Credentials DeSerializeCredentials()
in java/src/main/java/com/alexa/awisapi/AWIS.java
18 4 0
16 4 1
13 4 1
protected function buildHeaders()
in legacy/php/urlinfo.php
16 4 1
13 4 1
String PerformSRPAuthentication()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
22 3 2
private RespondToAuthChallengeRequest userSrpAuthRequest()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
43 3 2
private Mac createMac()
in java/src/main/java/com/alexa/awisapi/AuthenticationHelper.java
11 3 0
public static String makeRequest()
in java/src/main/java/com/alexa/awisapi/AWIS.java
22 3 5
public void run()
in java/src/main/java/com/alexa/awisapi/AWIS.java
11 3 0