aws-solutions / amazon-cloudwatch-monitoring-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
  • 37% duplication:
    • 2,520 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 934 duplicated lines
  • 115 duplicates
system37% (934 lines)
Duplication per Extension
ts36% (858 lines)
js90% (76 lines)
Duplication per Component (primary)
services/dashboardHandler/lib58% (550 lines)
services/tagHandler/lib56% (100 lines)
resources/lib13% (97 lines)
resources/lib/nginx46% (41 lines)
resources/lib/apache42% (41 lines)
services/tagHandler44% (31 lines)
resources/lib/puma14% (29 lines)
services/dashboardHandler61% (27 lines)
resources75% (18 lines)
services/helper0% (0 lines)
services/utils/error0% (0 lines)
services/utils/logger0% (0 lines)
services/utils/metrics0% (0 lines)

Duplication Between Components (50+ lines)

G services/dashboardHandler/lib services/dashboardHandler/lib services/tagHandler/lib services/tagHandler/lib services/dashboardHandler/lib--services/tagHandler/lib 120 resources/lib/apache resources/lib/apache resources/lib/nginx resources/lib/nginx resources/lib/apache--resources/lib/nginx 82 resources/lib/puma resources/lib/puma resources/lib/apache--resources/lib/puma 58 resources/lib/nginx--resources/lib/puma 58 services/dashboardHandler services/dashboardHandler services/tagHandler services/tagHandler services/dashboardHandler--services/tagHandler 54

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 115 duplicates...
Size#FoldersFilesLinesCode
35 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
apache_exports.ts
puma_exports.ts
131:168 (25%)
131:168 (11%)
view
32 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
nginx_exports.ts
puma_exports.ts
163:197 (19%)
131:165 (10%)
view
32 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
apache_exports.ts
nginx_exports.ts
131:165 (23%)
163:197 (19%)
view
26 x 2 source/services/dashboardHandler/lib
source/services/tagHandler/lib
SSMHelper.ts
SSMHelper.ts
27:58 (43%)
27:58 (43%)
view
26 x 2 source/services/dashboardHandler/lib
source/services/tagHandler/lib
SSMHelper.ts
SSMHelper.ts
62:96 (43%)
62:96 (43%)
view
21 x 2 source/services/dashboardHandler
source/services/tagHandler
jest.config.js
jest.config.js
16:54 (72%)
18:56 (67%)
view
19 x 2 source/resources/lib/apache
source/resources/lib/nginx
apache.demo.ts
nginx.demo.ts
21:40 (19%)
21:41 (21%)
view
18 x 2 source/resources
source/services/tagHandler
jest.config.js
jest.config.js
1:37 (75%)
1:37 (58%)
view
15 x 2 source/resources/lib
source/resources/lib
workload.infra.ts
workload.infra.ts
464:481 (4%)
487:504 (4%)
view
15 x 2 source/resources/lib
source/resources/lib
workload.infra.ts
workload.infra.ts
422:439 (4%)
464:481 (4%)
view
15 x 2 source/resources/lib
source/resources/lib
workload.infra.ts
workload.infra.ts
422:439 (4%)
487:504 (4%)
view
15 x 2 source/resources/lib
source/resources/lib
workload.infra.ts
workload.infra.ts
422:439 (4%)
443:460 (4%)
view
15 x 2 source/resources/lib
source/resources/lib
workload.infra.ts
workload.infra.ts
443:460 (4%)
464:481 (4%)
view
15 x 2 source/resources/lib
source/resources/lib
workload.infra.ts
workload.infra.ts
443:460 (4%)
487:504 (4%)
view
14 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
puma_exports.ts
puma_exports.ts
272:286 (4%)
296:310 (4%)
view
14 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
puma_exports.ts
puma_exports.ts
272:286 (4%)
320:334 (4%)
view
14 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
puma_exports.ts
puma_exports.ts
296:310 (4%)
320:334 (4%)
view
14 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
puma_exports.ts
puma_exports.ts
296:310 (4%)
344:358 (4%)
view
14 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
puma_exports.ts
puma_exports.ts
272:286 (4%)
344:358 (4%)
view
14 x 2 source/services/dashboardHandler/lib/widgets
source/services/dashboardHandler/lib/widgets
puma_exports.ts
puma_exports.ts
320:334 (4%)
344:358 (4%)
view