aws-solutions / serverless-bot-framework
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 108 units with 1,906 lines of code in units (63.9% of code).
    • 1 very long units (193 lines of code)
    • 4 long units (302 lines of code)
    • 26 medium size units (830 lines of code)
    • 17 small units (250 lines of code)
    • 60 very small units (331 lines of code)
10% | 15% | 43% | 13% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts35% | 24% | 25% | 2% | 11%
py0% | 13% | 54% | 13% | 17%
js0% | 0% | 0% | 58% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/infrastructure/lib35% | 24% | 25% | 2% | 11%
source/services/lex-bot/order_pizza0% | 31% | 62% | 5% | 1%
source/services/lex-bot/leave_feedback0% | 33% | 53% | 9% | 3%
source/services/lex-bot/book_appointment0% | 0% | 73% | 4% | 21%
source/services/lex-bot/other_intents0% | 0% | 84% | 8% | 7%
source/services/lex-bot/weather_forecast0% | 0% | 55% | 18% | 25%
source/services/solution-helper0% | 0% | 77% | 0% | 22%
source/services/webclient-setup0% | 0% | 36% | 35% | 28%
source/services/lex-bot0% | 0% | 0% | 48% | 51%
source/services/core0% | 0% | 0% | 58% | 41%
source/services/lex-bot/shared0% | 0% | 0% | 25% | 74%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/infrastructure/lib/cognito-api-lambdas-construct.ts
193 1 3
def slot_types()
in source/services/lex-bot/order_pizza/order_helpers.py
100 1 2
constructor()
in source/infrastructure/lib/custom-resource-lex-bot.ts
75 1 3
def feedback_slot_messages()
in source/services/lex-bot/leave_feedback/feedback_helpers.py
70 1 2
constructor()
in source/infrastructure/lib/web-client-custom-resource-construct.ts
57 1 3
def slot_messages()
in source/services/lex-bot/order_pizza/order_helpers.py
48 1 2
def update_order_intent()
in source/services/lex-bot/order_pizza/intent.py
47 1 4
constructor()
in source/infrastructure/lib/solution-helper-construct.ts
46 1 3
def order_utterances()
in source/services/lex-bot/order_pizza/order_helpers.py
43 1 1
def slot_message()
in source/services/lex-bot/book_appointment/appointment_helpers.py
40 1 2
def utterances()
in source/services/lex-bot/other_intents/help_intent.py
40 1 1
def feedback_utterances()
in source/services/lex-bot/leave_feedback/feedback_helpers.py
38 1 1
def create_appointment_intent()
in source/services/lex-bot/book_appointment/intent.py
36 3 2
def slot_types()
in source/services/lex-bot/book_appointment/appointment_helpers.py
34 1 1
def utterances()
in source/services/lex-bot/book_appointment/appointment_helpers.py
34 1 1
def utterances()
in source/services/lex-bot/weather_forecast/weather_helpers.py
34 1 1
constructor()
in source/infrastructure/lib/weather-forecast-lambda-ssm-construct.ts
34 1 3
def create_order_pizza_intent()
in source/services/lex-bot/order_pizza/intent.py
33 3 2
def utterances()
in source/services/lex-bot/other_intents/name_intent.py
31 1 1
def create_slot()
in source/services/lex-bot/leave_feedback/intent.py
29 1 5