awslabs / aws-servicebroker
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 832 units with 8,262 lines of code in units (27.9% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (230 lines of code)
    • 34 medium complex units (2,332 lines of code)
    • 71 simple units (1,292 lines of code)
    • 724 very simple units (4,408 lines of code)
0% | 2% | 28% | 15% | 53%
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% | 3% | 24% | 16% | 54%
go0% | 0% | 39% | 12% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sample-apps/rds0% | 5% | 17% | 18% | 58%
pkg/broker0% | 0% | 43% | 14% | 42%
sample-apps/route530% | 0% | 58% | 0% | 41%
sample-apps/elasticache0% | 0% | 64% | 0% | 35%
sample-apps/dynamodb0% | 0% | 62% | 0% | 37%
sample-apps/s30% | 0% | 63% | 0% | 36%
sample-apps/redshift0% | 0% | 55% | 0% | 44%
sample-apps/emr0% | 0% | 56% | 0% | 43%
sample-apps/sqs0% | 0% | 49% | 6% | 43%
cmd/servicebroker0% | 0% | 62% | 0% | 37%
templates/lex0% | 0% | 0% | 35% | 64%
functions/lex_custom_slot_type0% | 0% | 0% | 90% | 10%
functions/lex_intent0% | 0% | 0% | 90% | 10%
functions/generate_password0% | 0% | 0% | 64% | 35%
functions/generate_emrname0% | 0% | 0% | 76% | 23%
functions/generate_dbname0% | 0% | 0% | 76% | 23%
functions/lex_bot0% | 0% | 0% | 30% | 69%
functions/get_cidrs0% | 0% | 0% | 33% | 66%
functions/get_emrcidrs0% | 0% | 0% | 33% | 66%
pkg/dynamodbadapter0% | 0% | 0% | 0% | 100%
sample-apps/sns0% | 0% | 0% | 0% | 100%
functions/iam_service_linked_role0% | 0% | 0% | 0% | 100%
functions/get_azs0% | 0% | 0% | 0% | 100%
pkg/serviceinstance0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in sample-apps/rds/sample-app/src/pymysql/connections.py
109 44 31
def _cast()
in sample-apps/rds/sample-app/src/bottle.py
53 28 3
def run()
in sample-apps/rds/sample-app/src/bottle.py
68 28 10
func()
in pkg/broker/awsbroker.go
110 25 1
def static_file()
in sample-apps/rds/sample-app/src/bottle.py
60 20 5
func()
in pkg/broker/api.go
117 19 1
func()
in pkg/broker/api.go
100 19 1
def test_method()
in sample-apps/emr/sample-app/src/app.py
117 19 0
def add()
in sample-apps/rds/sample-app/src/bottle.py
61 19 5
def match()
in sample-apps/rds/sample-app/src/bottle.py
33 19 2
def connect()
in sample-apps/rds/sample-app/src/pymysql/connections.py
61 19 2
def read_code()
in sample-apps/rds/sample-app/src/bottle.py
44 18 2
func getCredentials()
in pkg/broker/util.go
50 17 3
func()
in pkg/broker/api.go
82 17 1
def test_method()
in sample-apps/sqs/sample-app/src/app.py
101 17 0
def _process_auth()
in sample-apps/rds/sample-app/src/pymysql/connections.py
56 17 3
def test_method()
in sample-apps/elasticache/sample-app/src/app.py
131 17 0
def test_method()
in sample-apps/route53/sample-app/src/app.py
141 17 0
func prescribeOverrides()
in pkg/broker/util.go
38 16 2
func()
in pkg/broker/api.go
75 16 1