awslabs / smithy-rs
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
  • 8% duplication:
    • 42,073 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,432 duplicated lines
  • 348 duplicates
system8% (3,432 lines)
Duplication per Extension
rs6% (1,837 lines)
kt9% (1,189 lines)
kts36% (294 lines)
toml10% (98 lines)
ts6% (14 lines)
Duplication per Component (primary)
rust-runtime7% (995 lines)
aws6% (888 lines)
codegen9% (851 lines)
codegen-server19% (401 lines)
tools4% (170 lines)
codegen-test46% (60 lines)
codegen-server-test35% (30 lines)
ROOT17% (26 lines)
buildSrc5% (11 lines)
design0% (0 lines)

Duplication Between Components (50+ lines)

G codegen-server codegen-server codegen codegen codegen-server--codegen 701 aws aws aws--codegen-server 66 aws--codegen 88 rust-runtime rust-runtime aws--rust-runtime 193 codegen-test codegen-test aws--codegen-test 104 codegen-server-test codegen-server-test codegen-server-test--codegen-test 60

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 348 duplicates...
Size#FoldersFilesLinesCode
77 x 2 codegen-server/src/main/...thy/generators/protocol
codegen/src/main/kotlin/...thy/generators/protocol
ServerProtocolTestGenerator.kt
ProtocolTestGenerator.kt
357:450 (14%)
364:459 (21%)
view
35 x 2 codegen-server/src/main/...server/smithy/protocols
codegen/src/main/kotlin/...odegen/smithy/protocols
ServerRustXml.kt
RestXml.kt
57:103 (64%)
52:98 (64%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src
extension.rs
macros.rs
1:33 (31%)
1:33 (17%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src/routing
rust-runtime/aws-smithy-http-server/src/routing
future.rs
into_make_service.rs
1:33 (65%)
1:33 (60%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
macros.rs
into_make_service.rs
1:33 (17%)
1:33 (60%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
error.rs
into_make_service.rs
1:33 (68%)
1:33 (60%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
extension.rs
route.rs
1:33 (31%)
1:33 (36%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
macros.rs
future.rs
1:33 (17%)
1:33 (65%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src
error.rs
extension.rs
1:33 (68%)
1:33 (31%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
extension.rs
into_make_service.rs
1:33 (31%)
1:33 (60%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
error.rs
route.rs
1:33 (68%)
1:33 (36%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src/routing
rust-runtime/aws-smithy-http-server/src/routing
future.rs
route.rs
1:33 (65%)
1:33 (36%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
macros.rs
route.rs
1:33 (17%)
1:33 (36%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
extension.rs
future.rs
1:33 (31%)
1:33 (65%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src/routing
rust-runtime/aws-smithy-http-server/src/routing
into_make_service.rs
route.rs
1:33 (60%)
1:33 (36%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src
error.rs
macros.rs
1:33 (68%)
1:33 (17%)
view
30 x 2 rust-runtime/aws-smithy-http-server/src
rust-runtime/aws-smithy-http-server/src/routing
error.rs
future.rs
1:33 (68%)
1:33 (65%)
view
25 x 2 rust-runtime/aws-smithy-async/src/future
rust-runtime/aws-smithy-http-server/src
timeout.rs
error.rs
10:34 (28%)
9:33 (56%)
view
25 x 2 rust-runtime/aws-smithy-async/src/future
rust-runtime/aws-smithy-http-server/src/routing
timeout.rs
into_make_service.rs
10:34 (28%)
9:33 (50%)
view
25 x 2 rust-runtime/aws-smithy-async/src/future
rust-runtime/aws-smithy-http-server/src
timeout.rs
macros.rs
10:34 (28%)
9:33 (14%)
view
Duplicated Units
The list of top 15 duplicated units.
See data for all 15 unit duplicates...
Size#FoldersFilesLinesCode
13 x 2 rust-runtime/inlineable/src
rust-runtime/inlineable/src
rest_xml_wrapped_errors.rs
rest_xml_unwrapped_errors.rs
70:86 
53:66 
view
14 x 2 aws/rust-runtime/aws-config/src/environment
aws/rust-runtime/aws-config/src/environment
credentials.rs
credentials.rs
121:136 
159:174 
view
14 x 2 rust-runtime/aws-smithy-client/src
rust-runtime/aws-smithy-client/src
hyper_ext.rs
hyper_ext.rs
479:493 
508:522 
view
11 x 4 codegen/src/main/kotlin/...odegen/smithy/protocols
codegen/src/main/kotlin/...odegen/smithy/protocols
codegen/src/main/kotlin/...odegen/smithy/protocols
codegen/src/main/kotlin/...odegen/smithy/protocols
AwsQuery.kt
RestXml.kt
Ec2Query.kt
RestJson.kt
37:50 
35:48 
34:47 
34:47 
view
11 x 2 codegen-server/src/main/...server/smithy/protocols
codegen-server/src/main/...server/smithy/protocols
ServerRustXml.kt
ServerRestJson.kt
40:53 
41:54 
view
10 x 2 tools/publisher/src
tools/publisher/src
package.rs
sort.rs
404:414 
82:92 
view
9 x 2 aws/rust-runtime/aws-config/src/profile/parser
aws/rust-runtime/aws-config/src/profile/parser
source.rs
source.rs
303:312 
339:348 
view
9 x 2 aws/rust-runtime/aws-inlineable/src
aws/rust-runtime/aws-inlineable/src
hosted_zone_preprocessor.rs
hosted_zone_preprocessor.rs
27:36 
39:48 
view
9 x 2 aws/rust-runtime/aws-sigv4/src/http_request
aws/rust-runtime/aws-sigv4/src/http_request
query_writer.rs
query_writer.rs
81:90 
93:102 
view
8 x 2 aws/rust-runtime/aws-sigv4/src/http_request
aws/rust-runtime/aws-sigv4/src/http_request
canonical_request.rs
canonical_request.rs
620:629 
632:641 
view
7 x 3 codegen-server-test
aws/sdk-codegen-test
codegen-test
build.gradle.kts
build.gradle.kts
build.gradle.kts
81:88 
66:73 
122:129 
view
7 x 2 codegen/src/main/kotlin/...thy/rust/codegen/smithy
aws/sdk-codegen/src/main...e/amazon/smithy/rustsdk
RuntimeTypes.kt
AwsRuntimeDependency.kt
47:55 
17:25 
view
7 x 2 rust-runtime/aws-smithy-json/src/deserialize
rust-runtime/aws-smithy-json/src/deserialize
token.rs
token.rs
406:413 
416:423 
view
6 x 2 rust-runtime/aws-smithy-client/src
rust-runtime/aws-smithy-client/src
timeout.rs
hyper_ext.rs
81:87 
346:352 
view
6 x 2 rust-runtime/aws-smithy-client/src
rust-runtime/aws-smithy-client/src
hyper_ext.rs
never.rs
678:684 
90:96 
view