aws-samples / aws-serverless-saas-layers
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 173 units with 1,660 lines of code in units (27.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 16 medium size units (558 lines of code)
    • 35 small units (502 lines of code)
    • 122 very small units (600 lines of code)
0% | 0% | 33% | 30% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 51% | 28% | 19%
py0% | 0% | 0% | 32% | 67%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Solution/Lab40% | 0% | 61% | 11% | 27%
Lab4/server0% | 0% | 57% | 23% | 18%
Solution/Lab10% | 0% | 30% | 30% | 39%
Lab1/server0% | 0% | 48% | 28% | 22%
Solution/Lab30% | 0% | 16% | 43% | 39%
Solution/Lab20% | 0% | 17% | 41% | 41%
Lab3/server0% | 0% | 30% | 48% | 20%
Lab2/server0% | 0% | 36% | 42% | 21%
Lab3/client0% | 0% | 0% | 32% | 67%
Lab4/client0% | 0% | 0% | 32% | 67%
Lab1/client0% | 0% | 0% | 34% | 65%
Lab2/client0% | 0% | 0% | 34% | 65%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function createTenantProductTable()
in Solution/Lab4/server/layers/nodejs/partition-manager.js
49 3 4
function createTenantOrderTable()
in Solution/Lab4/server/layers/nodejs/partition-manager.js
49 3 4
function createTenantProductTable()
in Lab4/server/layers/nodejs/partition-manager.js
49 3 4
function createTenantOrderTable()
in Lab4/server/layers/nodejs/partition-manager.js
49 3 4
module.exports.getOrder = function()
in Solution/Lab4/server/order-manager/order-manager-dal.js
36 4 2
module.exports.getProduct = function()
in Solution/Lab4/server/product-manager/product-manager-dal.js
36 4 2
module.exports.createTable = function()
in Solution/Lab1/server/order-manager/Utils/helper.js
29 4 2
module.exports.createTable = function()
in Solution/Lab1/server/product-manager/Utils/helper.js
29 4 2
module.exports.createTable = function()
in Solution/Lab3/server/layers/nodejs/helper.js
29 4 2
module.exports.createTable = function()
in Solution/Lab2/server/layers/nodejs/helper.js
29 4 2
module.exports.createTable = function()
in Solution/Lab4/server/layers/nodejs/helper.js
29 4 2
module.exports.createTable = function()
in Lab1/server/order-manager/Utils/helper.js
29 4 2
module.exports.createTable = function()
in Lab1/server/product-manager/Utils/helper.js
29 4 2
module.exports.createTable = function()
in Lab3/server/layers/nodejs/helper.js
29 4 2
module.exports.createTable = function()
in Lab2/server/layers/nodejs/helper.js
29 4 2
module.exports.createTable = function()
in Lab4/server/layers/nodejs/helper.js
29 4 2
module.exports.getOrder = function()
in Solution/Lab3/server/order-manager/order-manager-dal.js
20 3 2
module.exports.getProduct = function()
in Solution/Lab3/server/product-manager/product-manager-dal.js
20 3 2
module.exports.getOrder = function()
in Lab4/server/order-manager/order-manager-dal.js
20 3 2
module.exports.getProduct = function()
in Lab4/server/product-manager/product-manager-dal.js
20 3 2