aws-samples / aws-bookstore-demo-app
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 72 units with 851 lines of code in units (9.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (52 lines of code)
    • 1 simple units (16 lines of code)
    • 70 very simple units (783 lines of code)
0% | 0% | 6% | 1% | 92%
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
tsx0% | 0% | 8% | 2% | 88%
js0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
assets/src/modules/signup0% | 0% | 39% | 0% | 60%
assets/src/common/friendRecommendations0% | 0% | 0% | 53% | 46%
functions/setup0% | 0% | 0% | 0% | 100%
assets/src/modules/cart0% | 0% | 0% | 0% | 100%
assets/src0% | 0% | 0% | 0% | 100%
assets/src/modules/pastPurchases0% | 0% | 0% | 0% | 100%
assets/src/modules/bestSellers0% | 0% | 0% | 0% | 100%
assets/src/modules/category0% | 0% | 0% | 0% | 100%
assets/src/modules/checkout0% | 0% | 0% | 0% | 100%
functions/APIs0% | 0% | 0% | 0% | 100%
assets/src/modules/search0% | 0% | 0% | 0% | 100%
assets/src/modules/friends0% | 0% | 0% | 0% | 100%
functions/streaming0% | 0% | 0% | 0% | 100%
assets/src/common0% | 0% | 0% | 0% | 100%
assets/src/common/starRating0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
renderLanding()
in assets/src/modules/signup/Home.tsx
52 14 0
render()
in assets/src/common/friendRecommendations/FriendRecommendations.tsx
16 6 0
export default function register()
in assets/src/registerServiceWorker.ts
22 5 0
getCardNumberValidationState()
in assets/src/modules/checkout/checkoutForm/CheckoutForm.tsx
6 5 0
async componentDidMount()
in assets/src/modules/search/SearchGallery.tsx
24 5 0
function registerValidSW()
in assets/src/registerServiceWorker.ts
23 4 1
render()
in assets/src/modules/pastPurchases/PastPurchases.tsx
28 4 0
def handler()
in functions/streaming/updateSearchCluster.py
12 4 2
function checkValidServiceWorker()
in assets/src/registerServiceWorker.ts
22 3 1
render()
in assets/src/modules/cart/CartProductRow.tsx
38 3 0
render()
in assets/src/modules/cart/ShoppingCart.tsx
12 3 0
async componentDidMount()
in assets/src/modules/bestSellers/BestSellers.tsx
16 3 0
def handler()
in functions/APIs/search.py
23 3 2
function uploadBooksData()
in functions/setup/uploadBooks.js
20 3 1
export function unregister()
in assets/src/registerServiceWorker.ts
7 2 0
render()
in assets/src/common/starRating/StarRating.tsx
4 2 0
async componentDidMount()
in assets/src/common/friendRecommendations/FriendRecommendations.tsx
8 2 0
async componentDidMount()
in assets/src/modules/pastPurchases/PastPurchases.tsx
13 2 0
async componentDidMount()
in assets/src/modules/pastPurchases/PurchasedProductRow.tsx
8 2 0
async componentDidMount()
in assets/src/modules/cart/CartProductRow.tsx
8 2 0