aws-samples / aws-cross-account-serverless-microservices
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 32 units with 370 lines of code in units (16.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (150 lines of code)
    • 8 small units (127 lines of code)
    • 19 very small units (93 lines of code)
0% | 0% | 40% | 34% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 59% | 30% | 9%
js0% | 0% | 14% | 39% | 46%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Custom0% | 0% | 53% | 30% | 16%
Booking0% | 0% | 73% | 23% | 3%
Airmiles0% | 0% | 58% | 41% | 0%
WebUI/build0% | 0% | 17% | 38% | 44%
WebUI/config0% | 0% | 0% | 64% | 35%
WebUI/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def handler()
in Booking/post-bookings-lambda.py
44 1 2
def send()
in Custom/crhelper.py
31 8 7
def cfn_handler()
in Custom/crhelper.py
28 10 7
def handler()
in Airmiles/post-airmiles-lambda.py
24 4 2
module.exports = function()
in WebUI/build/check-versions.js
23 5 0
webpack()
in WebUI/build/build.js
20 3 3
def log_config()
in Custom/crhelper.py
19 8 3
function generateLoaders()
in WebUI/build/utils.js
19 3 2
def handler()
in Airmiles/get-airmiles-lambda.py
17 2 2
def get_exports()
in Custom/custom-lookup-exports.py
15 4 0
def handler()
in Booking/get-bookings-lambda.py
14 2 2
exports.styleLoaders = function()
in WebUI/build/utils.js
12 2 1
env: require()
in WebUI/config/index.js
11 1 1
exports.cssLoaders = function()
in WebUI/build/utils.js
9 2 1
scss: generateLoaders()
in WebUI/build/utils.js
9 2 1
stylus: generateLoaders()
in WebUI/build/utils.js
8 2 1
export function sleep()
in WebUI/src/widgets/interface.js
8 3 1
currentVersion: exec()
in WebUI/build/check-versions.js
7 2 1
styl: generateLoaders()
in WebUI/build/utils.js
7 2 1
exports.assetsPath = function()
in WebUI/build/utils.js
6 2 1