aws-samples / iot-reference-architectures
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 429 units with 3,130 lines of code in units (49.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 13 simple units (449 lines of code)
    • 416 very simple units (2,681 lines of code)
0% | 0% | 0% | 14% | 85%
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% | 0% | 27% | 72%
java0% | 0% | 0% | 8% | 91%
cs0% | 0% | 0% | 63% | 36%
go0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cross-account-publish0% | 0% | 0% | 60% | 39%
cross-account-register-ztp0% | 0% | 0% | 61% | 38%
greengrass-v20% | 0% | 0% | 17% | 82%
dynamodb-api0% | 0% | 0% | 7% | 92%
cloudwatch-events0% | 0% | 0% | 71% | 28%
serverless-ui0% | 0% | 0% | 1% | 98%
partner-attribution0% | 0% | 0% | 0% | 100%
cbor-stack0% | 0% | 0% | 0% | 100%
amazon-ion-stack0% | 0% | 0% | 0% | 100%
tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public static Object fromDynamoDbAttributeValue()
in dynamodb-api/src/main/java/com/awssamples/iot/dynamodb/api/SharedHelper.java
33 10 1
def check_payload_for_outliers()
in greengrass-v2/poll-api/artifacts/com.greengrass.ProcessApiStream/1.0.0/process.py
15 9 4
public static AttributeValue toDynamoDbAttributeValue()
in dynamodb-api/src/main/java/com/awssamples/iot/dynamodb/api/SharedHelper.java
35 9 1
def lambda_handler()
in cross-account-register-ztp/python/lambda/lambda_function.py
84 9 2
def find_key_name()
in greengrass-v2/poll-api/artifacts/com.greengrass.GGUtils/1.0.0/GGUtils.py
7 8 3
public CertificateBasedStack()
in cross-account-publish/certificate-based-stack/src/main/java/com/awssamples/crossaccountpublish/CertificateBasedStack.java
104 8 2
def process_message_list()
in greengrass-v2/poll-api/artifacts/com.greengrass.ProcessApiStream/1.0.0/process.py
13 7 7
static void Main()
in cross-account-publish/c-sharp/ConsoleApp1/ConsoleApp1/Program.cs
69 7 1
def lambda_handler()
in cloudwatch-events/python/customer-triggered-on-create-thing.py
32 7 2
public String detect()
in serverless-ui/jwt-stack/src/main/java/com/awssamples/server/StaticFileServlet.java
12 7 2
def inner_clean_up()
in greengrass-v2/poll-api/artifacts/com.greengrass.CleanUpExportFiles/1.0.0/cleanup.py
16 6 1
def get_min_and_max_sequence_numbers()
in greengrass-v2/poll-api/artifacts/com.greengrass.GGUtils/1.0.0/GGUtils.py
8 6 1
def loop_over_stream()
in greengrass-v2/poll-api/artifacts/com.greengrass.GGUtils/1.0.0/GGUtils.py
21 6 5
def cleanup_resources()
in cross-account-register-ztp/python/lambda/lambda_function.py
20 5 3
private AuthorizationResponse innerHandleRequest()
in serverless-ui/jwt-stack/src/main/java/com/awssamples/server/Authorizer.java
47 5 2
def loop_main_task()
in greengrass-v2/poll-api/artifacts/com.greengrass.GGUtils/1.0.0/GGUtils.py
11 4 1
def data()
in greengrass-v2/poll-api/artifacts/com.greengrass.FakeApi/1.0.0/app.py
23 4 0
def filter_message_list()
in greengrass-v2/poll-api/artifacts/com.greengrass.FilterApiStream/1.0.0/filter.py
11 4 3
private static Credentials GetCrossAccountCredentials()
in cross-account-publish/c-sharp/ConsoleApp1/ConsoleApp1/Program.cs
39 4 2
def lambda_handler()
in cloudwatch-events/python/partner-triggered-on-create-thing.py
13 4 2