aws-samples / alexa-top-sites-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 35 units with 410 lines of code in units (56.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (34 lines of code)
    • 0 simple units (0 lines of code)
    • 34 very simple units (376 lines of code)
0% | 0% | 8% | 0% | 91%
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
py0% | 0% | 75% | 0% | 24%
php0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
pl0% | 0% | 0% | 0% | 100%
cs0% | 0% | 0% | 0% | 100%
js0% | 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
python0% | 0% | 75% | 0% | 24%
legacy/php0% | 0% | 0% | 0% | 100%
legacy/java0% | 0% | 0% | 0% | 100%
legacy/perl0% | 0% | 0% | 0% | 100%
java/src/main/java/com/alexa/atsapi0% | 0% | 0% | 0% | 100%
php0% | 0% | 0% | 0% | 100%
dotnet0% | 0% | 0% | 0% | 100%
javascript0% | 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/topsites.py
34 20 1
public static String makeRequest()
in legacy/java/TopSites.java
20 5 3
public static void main()
in java/src/main/java/com/alexa/atsapi/ATS.java
14 4 1
protected function buildHeaders()
in legacy/php/topsites.php
16 4 1
public static String makeRequest()
in java/src/main/java/com/alexa/atsapi/ATS.java
20 3 2
public static void main()
in legacy/java/TopSites.java
31 3 1
sub compose_url()
in legacy/perl/topsites.pl
35 3 0
def sortQueryString()
in python/topsites.py
8 2 1
15 2 0
public static String bytesToHex()
in legacy/java/TopSites.java
5 2 1
protected function buildQueryParams()
in legacy/php/topsites.php
15 2 0
7 2 1
static void Main()
in dotnet/Program.cs
12 2 1
public ATS()
in java/src/main/java/com/alexa/atsapi/ATS.java
4 1 1
private static void callATS()
in java/src/main/java/com/alexa/atsapi/ATS.java
9 1 1
function callATS()
in javascript/topsites.js
14 1 2
def usage()
in python/topsites.py
3 1 0
function __construct()
in php/topsites.php
5 1 2
6 1 0
14 1 1