aws-samples / aws-saas-factory-serverless-workshop
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 1,133 units with 14,992 lines of code in units (74.0% of code).
    • 9 very complex units (3,313 lines of code)
    • 8 complex units (1,223 lines of code)
    • 31 medium complex units (1,562 lines of code)
    • 56 simple units (1,591 lines of code)
    • 1,029 very simple units (7,303 lines of code)
22% | 8% | 10% | 10% | 48%
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
js39% | 13% | 11% | 7% | 28%
java0% | 1% | 8% | 15% | 74%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lab1/server38% | 12% | 12% | 6% | 30%
resources/registration-service0% | 17% | 11% | 0% | 71%
resources/custom-resources0% | 0% | 27% | 37% | 35%
lab4/product-service0% | 0% | 13% | 7% | 78%
resources/auth-service0% | 0% | 28% | 13% | 57%
lab2/server0% | 0% | 6% | 0% | 93%
lab3/order-service0% | 0% | 2% | 26% | 71%
lab4/order-service0% | 0% | 2% | 28% | 69%
resources/tenant-service0% | 0% | 0% | 25% | 74%
lab2/client0% | 0% | 0% | 5% | 94%
resources/lambda-authorizer0% | 0% | 0% | 9% | 90%
lab4/layers0% | 0% | 0% | 16% | 83%
resources/lambda-warmer0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
444 90 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
381 85 0
(function (global, factory)()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
943 82 2
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
351 77 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
315 75 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
269 72 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
241 71 0
function flip()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
59 54 2
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
310 52 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
266 50 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
200 38 0
public RegistrationService()
in resources/registration-service/src/main/java/com/amazon/aws/partners/saasfactory/RegistrationService.java
98 37 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
117 33 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
107 33 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
163 31 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
150 30 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
122 29 0
function getBoundaries()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
39 19 4
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
61 16 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
54 16 0