aws-amplify / amplify-codegen
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
  • 47% duplication:
    • 28,595 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 13,529 duplicated lines
  • 83,113 duplicates
system47% (13,529 lines)
Duplication per Extension
ts51% (12,477 lines)
graphql42% (417 lines)
js13% (410 lines)
gql94% (225 lines)
Duplication per Component (primary)
packages/graphql-types-generator/fixtures96% (9,662 lines)
packages/amplify-codegen-e2e-core/src36% (2,001 lines)
packages/graphql-types-generator/src14% (642 lines)
packages/appsync-modelgen-plugin/src10% (504 lines)
packages/graphql-docs-generator/fixtures45% (426 lines)
packages/graphql-docs-generator74% (176 lines)
packages/amplify-codegen/src3% (54 lines)
packages/graphql-types-generator100% (20 lines)
packages/amplify-codegen100% (20 lines)
packages/amplify-codegen/commands9% (12 lines)
packages/graphql-docs-generator/src2% (12 lines)
packages/amplify-codegen-e2e-core0% (0 lines)
packages/graphql-docs-generator/templates0% (0 lines)
ROOT0% (0 lines)
scripts0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 83,113 duplicates...
Size#FoldersFilesLinesCode
341 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
output.ts
274:637 (12%)
274:637 (12%)
view
341 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
test.ts
274:637 (12%)
269:632 (15%)
view
341 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
test.ts
274:637 (12%)
269:632 (15%)
view
300 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
output.ts
1992:2313 (11%)
1992:2313 (11%)
view
298 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
test.ts
1992:2310 (10%)
1987:2305 (13%)
view
298 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
test.ts
1992:2310 (10%)
1987:2305 (13%)
view
281 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
output.ts
1462:1759 (10%)
1462:1759 (10%)
view
281 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
test.ts
1462:1759 (10%)
1457:1754 (13%)
view
281 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
test.ts
1462:1759 (10%)
1457:1754 (13%)
view
264 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
starwars.service.ts
1992:2270 (9%)
1251:1529 (12%)
view
264 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
starwars.service.ts
1992:2270 (9%)
1251:1529 (12%)
view
264 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
starwars.service.ts
test.ts
1251:1529 (12%)
1987:2265 (12%)
view
259 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
starwars.service.ts
1462:1735 (9%)
727:1000 (12%)
view
259 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
starwars.service.ts
1462:1735 (9%)
727:1000 (12%)
view
259 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
starwars.service.ts
test.ts
727:1000 (12%)
1457:1730 (11%)
view
258 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
starwars.service.ts
1462:1734 (9%)
1251:1523 (12%)
view
258 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
output.ts
1462:1734 (9%)
1992:2264 (9%)
view
258 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
test.ts
test.ts
1457:1729 (11%)
1987:2259 (11%)
view
258 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
output.ts
1462:1734 (9%)
1992:2264 (9%)
view
258 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
angular.ts
starwars.service.ts
1992:2264 (9%)
727:999 (12%)
view
Duplicated Units
The list of top 18 duplicated units.
See data for all 18 unit duplicates...
Size#FoldersFilesLinesCode
153 x 3 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
starwars.service.ts
output.ts
angular.ts
2111:2264 
2854:3007 
2854:3007 
view
145 x 3 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
starwars.service.ts
output.ts
angular.ts
1956:2101 
2702:2847 
2702:2847 
view
135 x 3 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
starwars.service.ts
output.ts
angular.ts
1691:1826 
2444:2579 
2444:2579 
view
109 x 4 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
starwars.service.ts
starwars.service.ts
output.ts
angular.ts
1557:1666 
1837:1946 
2317:2426 
2317:2426 
view
13 x 2 packages/graphql-types-generator/src/typescript
packages/graphql-types-generator/src/typescript
codeGeneration.ts
codeGeneration.ts
122:135 
137:150 
view
10 x 3 packages/amplify-codegen/src/walkthrough
packages/amplify-codegen/src/callbacks
packages/amplify-codegen/src/callbacks
add.js
prePushUpdateCallback.js
prePushAddCallback.js
91:101 
43:53 
52:62 
view
7 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
todo.service.ts
todo-statements.js
165:172 
17:24 
view
6 x 2 packages/graphql-types-generator/src/scala
packages/graphql-types-generator/src/swift
language.js
language.ts
79:85 
47:53 
view
6 x 2 packages/appsync-modelgen-plugin/src
packages/appsync-modelgen-plugin/src
preset.ts
preset.ts
127:133 
168:174 
view
115 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
2315:2430 
2315:2430 
view
10 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
2431:2441 
2431:2441 
view
141 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
2442:2583 
2442:2583 
view
115 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
2584:2699 
2584:2699 
view
151 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
2700:2851 
2700:2851 
view
159 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
2852:3011 
2852:3011 
view
11 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
3012:3023 
3012:3023 
view
10 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
3024:3034 
3024:3034 
view
10 x 2 packages/graphql-types-generator/fixtures
packages/graphql-types-generator/fixtures
output.ts
angular.ts
3035:3045 
3035:3045 
view