aws-solutions / serverless-bot-framework
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 11% duplication:
    • 2,739 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 302 duplicated lines
  • 32 duplicates
system11% (302 lines)
Duplication per Extension
py15% (234 lines)
ts4% (42 lines)
js12% (26 lines)
Duplication per Component (primary)
source/services/lex-bot/book_appointment23% (74 lines)
source/services/lex-bot/leave_feedback16% (43 lines)
source/infrastructure/lib4% (42 lines)
source/services/lex-bot/order_pizza11% (38 lines)
source/services/lex-bot/other_intents23% (32 lines)
source/services/lex-bot/weather_forecast22% (31 lines)
source/services/lex-bot11% (16 lines)
source/services/polly-service38% (13 lines)
source/services/core12% (13 lines)
source/services/solution-helper0% (0 lines)
source/services/webclient-setup0% (0 lines)
source/services/lex-bot/shared0% (0 lines)
source/infrastructure0% (0 lines)
deployment/cdk-solution-helper0% (0 lines)

Duplication Between Components (50+ lines)

G source/services/lex-bot/book_appointment source/services/lex-bot/book_appointment source/services/lex-bot/leave_feedback source/services/lex-bot/leave_feedback source/services/lex-bot/book_appointment--source/services/lex-bot/leave_feedback 88 source/services/lex-bot/order_pizza source/services/lex-bot/order_pizza source/services/lex-bot/book_appointment--source/services/lex-bot/order_pizza 74 source/services/lex-bot/weather_forecast source/services/lex-bot/weather_forecast source/services/lex-bot/book_appointment--source/services/lex-bot/weather_forecast 68 source/services/lex-bot/leave_feedback--source/services/lex-bot/order_pizza 64

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 32 duplicates...
Size#FoldersFilesLinesCode
21 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/weather_forecast
intent.py
intent.py
58:78 (13%)
44:64 (30%)
view
16 x 2 source/services/lex-bot/other_intents
source/services/lex-bot/other_intents
help_intent.py
name_intent.py
78:93 (21%)
70:85 (24%)
view
13 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/leave_feedback
intent.py
intent.py
66:78 (8%)
51:63 (10%)
view
13 x 2 source/services/lex-bot/order_pizza
source/services/lex-bot/weather_forecast
intent.py
intent.py
61:73 (9%)
52:64 (19%)
view
13 x 2 source/services/lex-bot/leave_feedback
source/services/lex-bot/order_pizza
intent.py
intent.py
51:63 (10%)
61:73 (9%)
view
13 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/order_pizza
intent.py
intent.py
66:78 (8%)
61:73 (9%)
view
13 x 2 source/services/core
source/services/polly-service
jest.config.js
jest.config.js
13:25 (100%)
13:25 (100%)
view
13 x 2 source/services/lex-bot/leave_feedback
source/services/lex-bot/weather_forecast
intent.py
intent.py
51:63 (10%)
52:64 (19%)
view
12 x 2 source/services/lex-bot/leave_feedback
source/services/lex-bot/order_pizza
intent.py
intent.py
36:47 (9%)
48:59 (9%)
view
11 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/leave_feedback
intent.py
intent.py
117:127 (7%)
78:88 (9%)
view
10 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/leave_feedback
intent.py
intent.py
55:64 (6%)
38:47 (8%)
view
10 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/order_pizza
intent.py
intent.py
55:64 (6%)
50:59 (7%)
view
10 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/weather_forecast
appointment_helpers.py
weather_helpers.py
80:91 (6%)
46:57 (15%)
view
9 x 2 source/infrastructure/lib
source/infrastructure/lib
cognito-api-lambdas-construct.ts
cognito-api-lambdas-construct.ts
194:203 (4%)
244:253 (4%)
view
8 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/other_intents
intent.py
help_intent.py
117:124 (5%)
84:91 (10%)
view
8 x 2 source/services/lex-bot/leave_feedback
source/services/lex-bot/other_intents
intent.py
help_intent.py
78:85 (6%)
84:91 (10%)
view
8 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/other_intents
intent.py
name_intent.py
117:124 (5%)
76:83 (12%)
view
8 x 2 source/services/lex-bot/leave_feedback
source/services/lex-bot/other_intents
intent.py
name_intent.py
78:85 (6%)
76:83 (12%)
view
8 x 2 source/services/lex-bot
source/services/lex-bot
lambda_function.py
lambda_function.py
52:59 (5%)
68:75 (5%)
view
7 x 2 source/services/lex-bot/book_appointment
source/services/lex-bot/book_appointment
intent.py
intent.py
83:89 (4%)
181:187 (4%)
view