aws-samples / aws-saas-factory-serverless-workshop
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,133 units with 14,992 lines of code in units (74.0% of code).
    • 16 very long units (4,484 lines of code)
    • 27 long units (1,873 lines of code)
    • 101 medium size units (2,997 lines of code)
    • 116 small units (1,706 lines of code)
    • 873 very small units (3,932 lines of code)
29% | 12% | 19% | 11% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js53% | 11% | 10% | 8% | 15%
java0% | 13% | 31% | 15% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lab1/server51% | 7% | 10% | 9% | 20%
resources/custom-resources0% | 64% | 30% | 0% | 5%
lab2/client0% | 59% | 26% | 2% | 11%
resources/registration-service0% | 40% | 34% | 0% | 25%
resources/auth-service0% | 28% | 13% | 0% | 57%
lab2/server0% | 6% | 16% | 9% | 66%
resources/lambda-warmer0% | 83% | 0% | 0% | 16%
resources/tenant-service0% | 0% | 63% | 18% | 18%
lab4/product-service0% | 0% | 51% | 25% | 23%
lab3/order-service0% | 0% | 30% | 27% | 41%
lab4/order-service0% | 0% | 33% | 25% | 41%
resources/lambda-authorizer0% | 0% | 37% | 18% | 44%
lab4/layers0% | 0% | 16% | 37% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
(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
444 90 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
381 85 0
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
310 52 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
266 50 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
241 71 0
function()
in lab1/server/src/main/resources/public/js/bootstrap.esm.js
200 38 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()
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.esm.js
105 15 0
public RegistrationService()
in resources/registration-service/src/main/java/com/amazon/aws/partners/saasfactory/RegistrationService.java
98 37 0
public Object handleRequest()
in resources/custom-resources/ssm-put-param-secure/src/main/java/com/amazon/aws/partners/saasfactory/SSMPutParamSecure.java
95 13 2
function()
in lab1/server/src/main/resources/public/js/bootstrap.bundle.js
89 15 0
public Object handleRequest()
in resources/custom-resources/clear-s3-bucket/src/main/java/com/amazon/aws/partners/saasfactory/ClearS3Bucket.java
88 11 2