aws-samples / amazon-workmail-lambda-templates
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 79 units with 1,163 lines of code in units (47.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (63 lines of code)
    • 14 medium size units (468 lines of code)
    • 24 small units (362 lines of code)
    • 40 very small units (270 lines of code)
0% | 5% | 40% | 31% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 40% | 28% | 24%
js0% | 0% | 36% | 63% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
workmail-restricted-mailboxes-python0% | 64% | 0% | 0% | 35%
workmail-salesforce-python0% | 0% | 37% | 37% | 24%
workmail-save-and-update-email0% | 0% | 51% | 17% | 30%
workmail-translate-email0% | 0% | 40% | 22% | 36%
workmail-update-email0% | 0% | 48% | 27% | 24%
workmail-upstream-gateway-filter0% | 0% | 100% | 0% | 0%
workmail-hello-world-python0% | 0% | 100% | 0% | 0%
workmail-wordpress-python0% | 0% | 55% | 39% | 5%
workmail-chat-bot-python0% | 0% | 44% | 34% | 20%
workmail-stop-mail-storm0% | 0% | 36% | 63% | 0%
workmail-ws1-integration0% | 0% | 0% | 67% | 32%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def restricted_mailboxes_handler()
in workmail-restricted-mailboxes-python/src/app.py
63 9 2
def update_handler()
in workmail-save-and-update-email/src/app.py
49 14 2
def upstream_gateway_handler()
in workmail-upstream-gateway-filter/src/app.py
48 9 2
def lambda_handler()
in workmail-hello-world-python/src/app.py
43 13 2
def post_handler()
in workmail-wordpress-python/src/app.py
41 5 2
def chat_handler()
in workmail-chat-bot-python/src/app.py
37 8 2
def salesforce_handler()
in workmail-salesforce-python/src/app.py
36 13 2
async function createMissingAlarms()
in workmail-stop-mail-storm/src/app.js
30 3 2
def translate_handler()
in workmail-translate-email/src/app.py
30 12 2
def update_handler()
in workmail-update-email/src/app.py
28 12 2
def process_email()
in workmail-salesforce-python/src/sf_utils.py
28 7 3
def update_email_body()
in workmail-save-and-update-email/src/utils.py
26 9 2
def update_email_body()
in workmail-update-email/src/utils.py
24 8 1
def process_contact_and_account_id()
in workmail-salesforce-python/src/sf_utils.py
24 11 4
def update_email_body()
in workmail-translate-email/src/utils.py
24 8 2
def lambda_handler()
in workmail-ws1-integration/src/app.py
20 5 2
Threshold: parseInt()
in workmail-stop-mail-storm/src/app.js
20 4 1
async function emitNewMetric()
in workmail-stop-mail-storm/src/app.js
19 1 1
def get_meeeting_body()
in workmail-salesforce-python/src/sf_utils.py
19 6 2
def load_device_data()
in workmail-ws1-integration/src/ws1.py
18 2 1