awslabs / smithy-ruby
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
  • 36% duplication:
    • 26,823 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 9,713 duplicated lines
  • 3,828 duplicates
system36% (9,713 lines)
Duplication per Extension
rb41% (8,825 lines)
java16% (874 lines)
kts6% (14 lines)
Duplication per Component (primary)
codegen/projections46% (7,511 lines)
codegen/smithy-ruby-codegen-test97% (742 lines)
codegen/smithy-ruby-codegen12% (567 lines)
seahorse/spec20% (545 lines)
codegen/smithy-ruby-rails-codegen34% (307 lines)
seahorse/lib2% (34 lines)
codegen/smithy-ruby-rails-codegen-test8% (7 lines)
seahorse0% (0 lines)
codegen0% (0 lines)
sample-service/config0% (0 lines)
sample-service0% (0 lines)
sample-service/db0% (0 lines)
sample-service/app0% (0 lines)

Duplication Between Components (50+ lines)

G codegen/projections codegen/projections codegen/smithy-ruby-codegen-test codegen/smithy-ruby-codegen-test codegen/projections--codegen/smithy-ruby-codegen-test 1486 seahorse/spec seahorse/spec codegen/projections--seahorse/spec 126 codegen/smithy-ruby-codegen codegen/smithy-ruby-codegen codegen/smithy-ruby-rails-codegen codegen/smithy-ruby-rails-codegen codegen/smithy-ruby-codegen--codegen/smithy-ruby-rails-codegen 87 seahorse/lib seahorse/lib seahorse/lib--seahorse/spec 72

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 3,828 duplicates...
Size#FoldersFilesLinesCode
194 x 2 codegen/projections/white_label/spec
codegen/smithy-ruby-codegen-test/integration-specs
validators_spec.rb
validators_spec.rb
3:237 (100%)
3:237 (100%)
view
145 x 2 codegen/projections/white_label/spec
codegen/smithy-ruby-codegen-test/integration-specs
params_spec.rb
params_spec.rb
3:179 (100%)
3:179 (100%)
view
116 x 2 codegen/projections/white_label/spec
codegen/smithy-ruby-codegen-test/integration-specs
paginators_spec.rb
paginators_spec.rb
3:139 (100%)
3:139 (100%)
view
94 x 2 codegen/projections/white_label/spec
codegen/smithy-ruby-codegen-test/integration-specs
client_spec.rb
client_spec.rb
3:117 (100%)
3:117 (100%)
view
86 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
RestBuilderGeneratorBase.java
RestStubsGeneratorBase.java
312:429 (24%)
233:350 (44%)
view
65 x 2 codegen/projections/white_label/spec
codegen/smithy-ruby-codegen-test/integration-specs
errors_spec.rb
errors_spec.rb
3:76 (100%)
3:76 (100%)
view
58 x 2 codegen/projections/white_label/spec
codegen/smithy-ruby-codegen-test/integration-specs
waiters_spec.rb
waiters_spec.rb
3:68 (100%)
3:68 (100%)
view
53 x 2 codegen/projections/white_label/spec
codegen/smithy-ruby-codegen-test/integration-specs
types_spec.rb
types_spec.rb
3:63 (100%)
3:63 (100%)
view
35 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/weather/lib/weather
client.rb
client.rb
2304:2343 (2%)
447:486 (12%)
view
30 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
types.rb
types.rb
1335:1364 (3%)
1471:1500 (3%)
view
30 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
types.rb
types.rb
1199:1228 (3%)
1471:1500 (3%)
view
30 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
types.rb
types.rb
1199:1228 (3%)
1335:1364 (3%)
view
29 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
stubs.rb
stubs.rb
956:984 (2%)
1064:1092 (2%)
view
29 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
params.rb
params.rb
445:473 (3%)
479:507 (3%)
view
28 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
validators.rb
validators.rb
388:415 (3%)
420:447 (3%)
view
27 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
builders.rb
builders.rb
699:725 (3%)
751:777 (3%)
view
27 x 2 codegen/projections/rails_json/spec
codegen/projections/rails_json/spec
protocol_spec.rb
protocol_spec.rb
2746:2774 (<1%)
2813:2841 (<1%)
view
26 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
parsers.rb
parsers.rb
605:630 (3%)
654:679 (3%)
view
26 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
stubs.rb
stubs.rb
990:1015 (2%)
1097:1122 (2%)
view
26 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
RestBuilderGeneratorBase.java
RestStubsGeneratorBase.java
435:468 (7%)
356:389 (13%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 44 unit duplicates...
Size#FoldersFilesLinesCode
25 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
RestStubsGeneratorBase.java
RestBuilderGeneratorBase.java
278:304 
357:383 
view
23 x 2 codegen/smithy-ruby-rail...ol/railsjson/generators
codegen/smithy-ruby-rail...ol/railsjson/generators
BuilderGenerator.java
StubsGenerator.java
243:267 
237:261 
view
19 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
RestStubsGeneratorBase.java
RestBuilderGeneratorBase.java
377:399 
456:476 
view
12 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/white_label/lib/white_label
validators.rb
validators.rb
112:125 
13:26 
view
12 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
RestStubsGeneratorBase.java
RestBuilderGeneratorBase.java
321:333 
400:412 
view
11 x 2 codegen/smithy-ruby-code...mithy/ruby/codegen/util
codegen/smithy-ruby-code...mithy/ruby/codegen/util
ParamsToHash.java
ParamsToHash.java
202:215 
218:231 
view
11 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
ValidatorsGenerator.java
ParamsGenerator.java
91:103 
89:101 
view
11 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
RestStubsGeneratorBase.java
RestBuilderGeneratorBase.java
307:318 
386:397 
view
10 x 2 codegen/smithy-ruby-rail...ol/railsjson/generators
codegen/smithy-ruby-rail...ol/railsjson/generators
BuilderGenerator.java
StubsGenerator.java
347:358 
331:342 
view
10 x 2 codegen/smithy-ruby-code...zon/smithy/ruby/codegen
codegen/smithy-ruby-code...zon/smithy/ruby/codegen
RubySymbolProvider.java
RubySymbolProvider.java
256:266 
269:279 
view
9 x 4 codegen/projections/high.../lib/high_score_service
codegen/projections/rails_json/lib/rails_json
codegen/projections/white_label/lib/white_label
codegen/projections/weather/lib/weather
client.rb
client.rb
client.rb
client.rb
46:57 
45:56 
64:75 
46:57 
view
8 x 2 codegen/projections/white_label/lib/white_label
codegen/projections/weather/lib/weather
paginators.rb
paginators.rb
112:121 
42:51 
view
8 x 2 codegen/smithy-ruby-code...ruby/codegen/generators
codegen/smithy-ruby-code...ruby/codegen/generators
RestBuilderGeneratorBase.java
RestBuilderGeneratorBase.java
579:587 
590:598 
view
7 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
stubs.rb
stubs.rb
271:279 
621:629 
view
7 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
stubs.rb
stubs.rb
473:481 
513:521 
view
7 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
stubs.rb
stubs.rb
553:561 
641:649 
view
7 x 2 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
stubs.rb
stubs.rb
737:745 
757:765 
view
7 x 3 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
codegen/projections/white_label/lib/white_label
params.rb
params.rb
params.rb
42:50 
146:154 
33:41 
view
7 x 3 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
codegen/projections/white_label/lib/white_label
params.rb
params.rb
params.rb
72:80 
83:91 
55:63 
view
7 x 3 codegen/projections/rails_json/lib/rails_json
codegen/projections/rails_json/lib/rails_json
codegen/projections/white_label/lib/white_label
params.rb
params.rb
params.rb
212:220 
389:397 
95:103 
view