awslabs / tough
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
  • 12% duplication:
    • 7,872 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 986 duplicated lines
  • 75 duplicates
system12% (986 lines)
Duplication per Extension
rs12% (986 lines)
Duplication per Component (primary)
tough/src8% (463 lines)
tuftool/src23% (417 lines)
tough-kms/src25% (64 lines)
tough-ssm/src28% (42 lines)
tough-kms0% (0 lines)
ROOT0% (0 lines)
integ/failure-server0% (0 lines)
tough-ssm0% (0 lines)
olpc-cjson/src0% (0 lines)
olpc-cjson0% (0 lines)
tuftool0% (0 lines)
tough0% (0 lines)

Duplication Between Components (50+ lines)

G tough/src tough/src tuftool/src tuftool/src tough/src--tuftool/src 102 tough-kms/src tough-kms/src tough-ssm/src tough-ssm/src tough-kms/src--tough-ssm/src 84

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 75 duplicates...
Size#FoldersFilesLinesCode
86 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
263:388 (19%)
437:562 (19%)
view
16 x 2 tough-kms/src
tough-ssm/src
error.rs
error.rs
36:57 (16%)
32:50 (28%)
view
16 x 2 tuftool/src
tuftool/src
create.rs
update.rs
20:49 (20%)
24:53 (11%)
view
12 x 2 tuftool/src
tuftool/src
add_key_role.rs
remove_key_role.rs
84:96 (17%)
68:80 (22%)
view
12 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
488:499 (2%)
530:541 (2%)
view
12 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
356:367 (2%)
488:499 (2%)
view
12 x 2 tuftool/src
tuftool/src
remove_key_role.rs
remove_role.rs
68:80 (22%)
67:79 (22%)
view
12 x 2 tough/src/editor
tough/src/editor
mod.rs
targets.rs
318:334 (2%)
204:220 (3%)
view
12 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
314:325 (2%)
356:367 (2%)
view
12 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
314:325 (2%)
530:541 (2%)
view
12 x 2 tuftool/src
tuftool/src
add_key_role.rs
remove_key_role.rs
30:51 (17%)
30:51 (22%)
view
12 x 2 tuftool/src
tuftool/src
add_key_role.rs
remove_role.rs
84:96 (17%)
67:79 (22%)
view
11 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
290:301 (2%)
438:449 (2%)
view
11 x 2 tuftool/src
tuftool/src
add_key_role.rs
remove_role.rs
30:50 (16%)
25:45 (20%)
view
11 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
438:449 (2%)
464:475 (2%)
view
11 x 2 tough-kms/src
tough-ssm/src
error.rs
error.rs
20:32 (11%)
18:29 (19%)
view
11 x 2 tuftool/src
tuftool/src
remove_key_role.rs
remove_role.rs
4:14 (20%)
4:14 (20%)
view
11 x 2 tuftool/src
tuftool/src
remove_key_role.rs
remove_role.rs
30:50 (20%)
25:45 (20%)
view
11 x 2 tough/src/editor
tough/src/editor
signed.rs
signed.rs
264:275 (2%)
290:301 (2%)
view
11 x 2 tuftool/src
tuftool/src
add_key_role.rs
create_role.rs
5:15 (16%)
4:14 (23%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 tough/src/schema
tough/src/schema
verify.rs
verify.rs
106:114 
117:125 
view
6 x 2 tough/src/editor
tough/src/editor
mod.rs
targets.rs
747:753 
586:592 
view
6 x 2 tough/src/editor
tough/src/editor
test.rs
test.rs
25:31 
41:47 
view
6 x 2 tough/src/schema
tough/src/schema
mod.rs
mod.rs
361:367 
738:744 
view