awsdocs / aws-doc-sdk-examples
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 7,263 units with 121,050 lines of code in units (62.2% of code).
    • 1 very complex units (454 lines of code)
    • 3 complex units (591 lines of code)
    • 63 medium complex units (3,858 lines of code)
    • 391 simple units (14,626 lines of code)
    • 6,805 very simple units (101,521 lines of code)
<1% | <1% | 3% | 12% | 83%
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
cpp4% | 2% | 2% | 14% | 76%
cs0% | 2% | 6% | 10% | 80%
py0% | <1% | 7% | 23% | 68%
go0% | 0% | 4% | 23% | 72%
java0% | 0% | 1% | 7% | 91%
rb0% | 0% | 6% | 14% | 79%
kt0% | 0% | <1% | 2% | 97%
php0% | 0% | 0% | 8% | 91%
js0% | 0% | 0% | 3% | 96%
ts0% | 0% | 0% | 0% | 100%
rs0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cpp4% | 2% | 2% | 14% | 76%
dotnetv30% | 2% | 6% | 10% | 80%
lambda_functions0% | 5% | 5% | 40% | 49%
python0% | 0% | 7% | 20% | 72%
go0% | 0% | 2% | 19% | 77%
ruby0% | 0% | 6% | 14% | 79%
gov20% | 0% | 7% | 35% | 57%
java0% | 0% | 1% | 11% | 87%
javav20% | 0% | <1% | 5% | 93%
scripts0% | 0% | 20% | 37% | 41%
kotlin0% | 0% | <1% | 2% | 97%
php0% | 0% | 0% | 8% | 91%
javascriptv30% | 0% | 0% | 4% | 95%
javascript0% | 0% | 0% | 2% | 97%
resources0% | 0% | 0% | 0% | 100%
typescript0% | 0% | 0% | 0% | 100%
rust_dev_preview0% | 0% | 0% | 0% | 100%
tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
bool AwsDoc::ACM::DescribeCertificate()
in cpp/example_code/acm/acm_basic_operations.cpp
454 90 2
static void Main()
in dotnetv3/dynamodb/GettingStarted/00_Main.cs
254 46 0
int main()
in cpp/example_code/acm/acm_basic_operations.cpp
233 42 2
def apply_database_permissions()
in lambda_functions/secretsmanager/RDSSQLServer-Multiuser.py
104 28 3
func main()
in go/cloudtrail/cloudtrailOps.go
104 22 0
def check_files()
in scripts/legacy/check_metadata.py
40 21 5
func main()
in go/example_code/cloudformation/CfnCrudOps.go
62 20 0
static void Main()
in dotnetv3/dynamodb/FromSQL/CreateIndexExample/CreateIndexExample/CreateIndex.cs
107 20 1
def usage_demo()
in python/example_code/iam/iam_basics/account_wrapper.py
80 18 0
def write_report()
in scripts/cleanup_report.py
59 18 5
def to_dict()
in python/example_code/rekognition/rekognition_objects.py
34 16 1
def create_app()
in python/cross_service/dynamodb_item_tracker/app.py
106 16 1
def replicate()
in python/example_code/ses/ses_replicate_identities.py
59 15 3
public String getData()
in javav2/usecases/Creating_etl_workflow/src/main/java/com/etl/example/ExcelService.java
75 15 2
Aws::String GetPermissionString()
in cpp/example_code/s3/get_acl.cpp
46 14 2
def demo_long_lived_cluster()
in python/example_code/emr/emr_usage_demo.py
85 14 0
def do_push_with_retries()
in python/example_code/codecommit/push-in-parts.py
34 14 3
def usage_demo()
in python/example_code/dynamodb/batching/dynamo_batching.py
74 14 0
def set_password_for_login()
in lambda_functions/secretsmanager/RDSSQLServer-Multiuser.py
26 14 4
public static async Task Main()
in dotnetv3/dynamodb/FromSQL/UpdateItemExample/UpdateItemExample/UpdateItem.cs
61 14 1