awslabs / aws-servicebroker
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
  • 53% duplication:
    • 28,632 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 15,365 duplicated lines
  • 5,458 duplicates
system53% (15,365 lines)
Duplication per Extension
yaml71% (12,712 lines)
py26% (2,127 lines)
html69% (336 lines)
yml27% (99 lines)
go5% (91 lines)
Duplication per Component (primary)
templates/rdsoracle81% (1,234 lines)
templates/rdsmariadb93% (1,159 lines)
templates/rdspostgresql89% (1,159 lines)
templates/rdsmysql90% (1,136 lines)
templates/auroramysql83% (1,083 lines)
templates/aurorapostgresql94% (1,077 lines)
templates/rdsmssql83% (1,051 lines)
templates/documentdb82% (799 lines)
templates/redshift72% (649 lines)
templates/lex71% (564 lines)
templates/elasticsearch60% (503 lines)
templates/mq57% (466 lines)
templates/elasticache69% (462 lines)
sample-apps/rds4% (271 lines)
sample-apps/redshift81% (235 lines)
sample-apps/route5371% (228 lines)
sample-apps/elasticache80% (222 lines)
sample-apps/s379% (217 lines)
sample-apps/dynamodb76% (215 lines)
sample-apps/emr68% (197 lines)
sample-apps/sqs68% (195 lines)
templates/cognito53% (185 lines)
templates/emr32% (172 lines)
templates/s338% (153 lines)
templates/athena39% (141 lines)
templates/kinesis60% (138 lines)
templates/kms54% (124 lines)
templates/dynamodb50% (122 lines)
templates/translate77% (115 lines)
templates/rekognition72% (113 lines)
templates/polly64% (112 lines)
templates/sns40% (103 lines)
templates/sqs31% (103 lines)
packaging/helm24% (85 lines)
templates/codecommit40% (78 lines)
pkg/broker5% (73 lines)
sample-apps/sns45% (63 lines)
functions/lex_custom_slot_type100% (52 lines)
functions/lex_intent100% (52 lines)
functions/iam_service_linked_role100% (49 lines)
functions/lex_bot100% (48 lines)
packaging/openshift12% (30 lines)
functions/generate_dbname78% (22 lines)
functions/generate_emrname78% (22 lines)
functions/get_cidrs68% (22 lines)
functions/get_emrcidrs68% (22 lines)
pkg/dynamodbadapter9% (18 lines)
functions/generate_password43% (16 lines)
functions/get_azs40% (10 lines)
ROOT0% (0 lines)
templates/route530% (0 lines)
pkg/serviceinstance0% (0 lines)
packaging/cloudfoundry0% (0 lines)
testcases0% (0 lines)
cmd/servicebroker0% (0 lines)
setup0% (0 lines)

Duplication Between Components (50+ lines)

G templates/rdsmariadb templates/rdsmariadb templates/rdspostgresql templates/rdspostgresql templates/rdsmariadb--templates/rdspostgresql 2294 templates/rdsmysql templates/rdsmysql templates/rdsmariadb--templates/rdsmysql 2124 templates/rdsoracle templates/rdsoracle templates/rdsmariadb--templates/rdsoracle 2054 templates/rdsmssql templates/rdsmssql templates/rdsmariadb--templates/rdsmssql 1939 templates/redshift templates/redshift templates/rdsmariadb--templates/redshift 1169 templates/rdspostgresql--templates/redshift 1177 templates/rdsmysql--templates/rdspostgresql 2126 templates/rdsmysql--templates/rdsoracle 2168 templates/rdsmysql--templates/redshift 1147 templates/rdsoracle--templates/rdspostgresql 2078 templates/rdsoracle--templates/redshift 1153 templates/rdsmssql--templates/rdspostgresql 1934 templates/rdsmssql--templates/rdsmysql 2013 templates/rdsmssql--templates/rdsoracle 2108 templates/rdsmssql--templates/redshift 1133 templates/auroramysql templates/auroramysql templates/auroramysql--templates/rdsmariadb 1400 templates/auroramysql--templates/rdspostgresql 1386 templates/auroramysql--templates/rdsmysql 1362 templates/auroramysql--templates/rdsoracle 1356 templates/auroramysql--templates/rdsmssql 1338 templates/aurorapostgresql templates/aurorapostgresql templates/auroramysql--templates/aurorapostgresql 2096 templates/documentdb templates/documentdb templates/auroramysql--templates/documentdb 1452 templates/auroramysql--templates/redshift 1043 templates/mq templates/mq templates/auroramysql--templates/mq 829 templates/aurorapostgresql--templates/rdsmariadb 1398 templates/aurorapostgresql--templates/rdspostgresql 1390 templates/aurorapostgresql--templates/rdsmysql 1360 templates/aurorapostgresql--templates/rdsoracle 1356 templates/aurorapostgresql--templates/rdsmssql 1336 templates/aurorapostgresql--templates/documentdb 1502 templates/aurorapostgresql--templates/redshift 1043 templates/aurorapostgresql--templates/mq 852 templates/documentdb--templates/rdsmariadb 1187 templates/documentdb--templates/rdspostgresql 1185 templates/documentdb--templates/rdsmysql 1151 templates/documentdb--templates/rdsoracle 1156 templates/documentdb--templates/rdsmssql 1140 templates/documentdb--templates/redshift 1015 templates/documentdb--templates/mq 837 templates/elasticache templates/elasticache templates/elasticache--templates/rdsmariadb 827 templates/elasticache--templates/rdspostgresql 827 templates/elasticache--templates/rdsmysql 827 templates/elasticache--templates/redshift 950 templates/mq--templates/rdsmariadb 874 templates/mq--templates/rdspostgresql 862 templates/mq--templates/rdsmysql 848 templates/mq--templates/rdsoracle 856 templates/mq--templates/rdsmssql 870 templates/mq--templates/redshift 827 templates/elasticsearch templates/elasticsearch templates/elasticsearch--templates/rdsoracle 831

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 5,458 duplicates...
Size#FoldersFilesLinesCode
408 x 2 templates/rdsmysql
templates/rdsoracle
template.yaml
template.yaml
790:1205 (33%)
1083:1507 (26%)
view
314 x 2 templates/rdsmariadb
templates/rdspostgresql
template.yaml
template.yaml
913:1234 (25%)
966:1287 (24%)
view
300 x 2 templates/auroramysql
templates/aurorapostgresql
template.yaml
template.yaml
1061:1377 (23%)
888:1204 (26%)
view
288 x 2 templates/rdsmysql
templates/rdspostgresql
template.yaml
template.yaml
948:1243 (23%)
967:1262 (22%)
view
288 x 2 templates/rdsmariadb
templates/rdsmysql
template.yaml
template.yaml
914:1209 (23%)
948:1243 (23%)
view
285 x 2 templates/rdspostgresql
templates/redshift
template.yaml
template.yaml
978:1270 (22%)
597:889 (32%)
view
285 x 2 templates/rdsmariadb
templates/redshift
template.yaml
template.yaml
925:1217 (23%)
597:889 (32%)
view
284 x 2 templates/aurorapostgresql
templates/rdspostgresql
template.yaml
template.yaml
905:1200 (25%)
978:1269 (22%)
view
284 x 2 templates/auroramysql
templates/rdsmariadb
template.yaml
template.yaml
1078:1373 (21%)
925:1216 (23%)
view
284 x 2 templates/documentdb
templates/redshift
template.yaml
template.yaml
732:1027 (29%)
597:888 (32%)
view
284 x 2 templates/aurorapostgresql
templates/rdsmariadb
template.yaml
template.yaml
905:1200 (25%)
925:1216 (23%)
view
284 x 2 templates/documentdb
templates/rdspostgresql
template.yaml
template.yaml
732:1027 (29%)
978:1269 (22%)
view
284 x 2 templates/documentdb
templates/rdsmariadb
template.yaml
template.yaml
732:1027 (29%)
925:1216 (23%)
view
284 x 2 templates/auroramysql
templates/documentdb
template.yaml
template.yaml
1078:1373 (21%)
732:1027 (29%)
view
284 x 2 templates/aurorapostgresql
templates/redshift
template.yaml
template.yaml
905:1200 (25%)
597:888 (32%)
view
284 x 2 templates/auroramysql
templates/redshift
template.yaml
template.yaml
1078:1373 (21%)
597:888 (32%)
view
284 x 2 templates/aurorapostgresql
templates/documentdb
template.yaml
template.yaml
905:1200 (25%)
732:1027 (29%)
view
284 x 2 templates/auroramysql
templates/rdspostgresql
template.yaml
template.yaml
1078:1373 (21%)
978:1269 (22%)
view
277 x 2 templates/rdsmysql
templates/redshift
template.yaml
template.yaml
959:1243 (22%)
597:881 (31%)
view
277 x 2 templates/documentdb
templates/rdsmysql
template.yaml
template.yaml
732:1016 (28%)
959:1243 (22%)
view
Duplicated Units
The list of top 16 duplicated units.
See data for all 16 unit duplicates...
Size#FoldersFilesLinesCode
119 x 2 sample-apps/redshift/sample-app/src
sample-apps/rds/sample-app/src
app.py
app.py
0:0 
0:0 
view
30 x 2 templates/lex/functions/lex_custom_slot_type
functions/lex_custom_slot_type
lambda_function.py
lambda_function.py
0:0 
0:0 
view
30 x 2 templates/lex/functions/lex_intent
functions/lex_intent
lambda_function.py
lambda_function.py
0:0 
0:0 
view
26 x 2 templates/lex/functions/lex_bot
functions/lex_bot
lambda_function.py
lambda_function.py
0:0 
0:0 
view
24 x 2 templates/lex/functions/iam_service_linked_role
functions/iam_service_linked_role
lambda_function.py
lambda_function.py
0:0 
0:0 
view
23 x 4 templates/lex/functions/iam_service_linked_role
templates/lex/functions/lex_bot
templates/lex/functions/lex_custom_slot_type
templates/lex/functions/lex_intent
cfnresponse.py
cfnresponse.py
cfnresponse.py
cfnresponse.py
0:0 
0:0 
0:0 
0:0 
view
13 x 2 templates/lex/functions/lex_bot
functions/lex_bot
lambda_function.py
lambda_function.py
0:0 
0:0 
view
13 x 2 templates/lex/functions/lex_custom_slot_type
functions/lex_custom_slot_type
lambda_function.py
lambda_function.py
0:0 
0:0 
view
13 x 2 templates/lex/functions/lex_intent
functions/lex_intent
lambda_function.py
lambda_function.py
0:0 
0:0 
view
12 x 2 templates/lex/functions/iam_service_linked_role
functions/iam_service_linked_role
lambda_function.py
lambda_function.py
0:0 
0:0 
view
12 x 2 pkg/broker
pkg/broker
util.go
util.go
318:330 
332:344 
view
10 x 9 sample-apps/sqs/sample-app/src
sample-apps/redshift/sample-app/src
sample-apps/sns/sample-app/src
sample-apps/emr/sample-app/src
sample-apps/s3/sample-app/src
sample-apps/rds/sample-app/src
sample-apps/dynamodb/sample-app/src
sample-apps/elasticache/sample-app/src
sample-apps/route53/sample-app/src
app.py
app.py
app.py
app.py
app.py
app.py
app.py
app.py
app.py
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
0:0 
view
9 x 2 sample-apps/redshift/sample-app/src
sample-apps/rds/sample-app/src
sampleaws.py
sampleaws.py
0:0 
0:0 
view
10 x 2 functions/get_cidrs
functions/get_emrcidrs
lambda_function.py
lambda_function.py
0:0 
0:0 
view
7 x 4 sample-apps/sqs/sample-app/src
sample-apps/sns/sample-app/src
sample-apps/emr/sample-app/src
sample-apps/route53/sample-app/src
sampleaws.py
sampleaws.py
sampleaws.py
sampleaws.py
0:0 
0:0 
0:0 
0:0 
view
6 x 2 templates/lex/functions/iam_service_linked_role
functions/iam_service_linked_role
lambda_function.py
lambda_function.py
0:0 
0:0 
view