aws-samples / retail-demo-store
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 566 units with 8,606 lines of code in units (17.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 26 medium complex units (1,994 lines of code)
    • 67 simple units (2,048 lines of code)
    • 473 very simple units (4,564 lines of code)
0% | 0% | 23% | 23% | 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% | 0% | 22% | 22% | 54%
js0% | 0% | 46% | 10% | 43%
go0% | 0% | 7% | 36% | 55%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/web-ui0% | 0% | 46% | 10% | 42%
src/aws-lambda0% | 0% | 20% | 22% | 57%
src/recommendations0% | 0% | 28% | 35% | 36%
generators0% | 0% | 79% | 10% | 9%
src/users0% | 0% | 25% | 20% | 53%
src/videos0% | 0% | 29% | 0% | 70%
workshop/3-Experimentation0% | 0% | 24% | 25% | 49%
src/products0% | 0% | 0% | 44% | 55%
src/carts0% | 0% | 0% | 48% | 51%
src/orders0% | 0% | 0% | 34% | 65%
generators/datagenerator0% | 0% | 0% | 10% | 89%
src/search0% | 0% | 0% | 0% | 100%
src/location0% | 0% | 0% | 0% | 100%
src/offers0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_products()
in src/recommendations/src/recommendations-service/app.py
70 25 8
def generate_interactions()
in generators/generate_interactions_personalize.py
187 25 3
def update()
in src/aws-lambda/personalize-pre-create-campaigns/personalize-pre-create-campaigns.py
223 23 0
def pinpoint_fire_location_approached_event()
in src/aws-lambda/location-geofence-event/location-geofence-event.py
56 19 4
def get_ranking()
in src/recommendations/src/recommendations-service/app.py
63 19 6
def handle_geofence_enter()
in src/aws-lambda/location-geofence-event/location-geofence-event.py
47 17 1
orderCompleted()
in src/web-ui/src/analytics/AnalyticsHandler.js
118 17 3
def get_top_n()
in src/recommendations/src/recommendations-service/app.py
65 17 5
def handle()
in src/aws-lambda/alexa-skill-lambda/alexa-skill-lambda.py
60 16 2
def lambda_handler()
in src/aws-lambda/pinpoint-auto-workshop/pinpoint-auto-workshop.py
142 15 2
async identify()
in src/web-ui/src/analytics/AnalyticsHandler.js
112 15 1
def lambda_handler()
in src/aws-lambda/segment-personalize-events-destination/segment-personalize-events-destination.py
34 13 2
def get_items()
in src/recommendations/src/recommendations-service/experimentation/experiment_interleaving.py
48 13 7
func UserIndex()
in src/users/src/users-service/handlers.go
50 13 2
def show_area()
in workshop/3-Experimentation/src/plot.py
24 13 5
productAddedToCart()
in src/web-ui/src/analytics/AnalyticsHandler.js
109 12 6
productViewed()
in src/web-ui/src/analytics/AnalyticsHandler.js
81 12 5
def coupon_offer()
in src/recommendations/src/recommendations-service/app.py
61 12 0
def get_items()
in src/recommendations/src/recommendations-service/experimentation/resolvers.py
33 12 2
def delete_campaign_polling()
in src/aws-lambda/personalize-pre-create-campaigns/personalize-pre-create-campaigns.py
39 11 3