aws / s2n-tls
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
  • 18% duplication:
    • 40,459 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 7,675 duplicated lines
  • 824 duplicates
system18% (7,675 lines)
Duplication per Extension
c19% (5,903 lines)
h18% (952 lines)
yml49% (436 lines)
S15% (276 lines)
py7% (80 lines)
rs2% (28 lines)
Duplication per Component (primary)
pq-crypto36% (5,032 lines)
tls11% (1,872 lines)
codebuild36% (440 lines)
crypto4% (152 lines)
scripts7% (48 lines)
utils3% (46 lines)
ROOT46% (28 lines)
bindings2% (28 lines)
error3% (20 lines)
stuffer1% (9 lines)
cmake0% (0 lines)
api0% (0 lines)
scram0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 824 duplicates...
Size#FoldersFilesLinesCode
203 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_r3
fips202_kyber_r2.c
kyber512r3_fips202.c
117:340 (56%)
110:333 (63%)
view
203 x 2 pq-crypto/sike_r1
pq-crypto/sike_r3
fips202_r1.c
sikep434r3_fips202.c
112:335 (62%)
119:342 (65%)
view
145 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
decode.c
decode.c
71:364 (100%)
71:364 (100%)
view
88 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
openssl_utils.c
openssl_utils.c
19:184 (100%)
19:184 (100%)
view
74 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
types.h
types.h
15:137 (100%)
15:137 (100%)
view
74 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
utilities.h
utilities.h
18:156 (100%)
18:156 (100%)
view
61 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
utilities.c
utilities.c
16:159 (100%)
16:159 (100%)
view
59 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
cleanup.h
cleanup.h
13:130 (100%)
13:130 (100%)
view
54 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
gf2x_portable.c
gf2x_portable.c
19:105 (100%)
19:105 (100%)
view
50 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
sampling.c
sampling.c
13:117 (100%)
13:117 (100%)
view
48 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
aes_ctr_prf.c
aes_ctr_prf.c
13:104 (100%)
13:104 (100%)
view
40 x 2 codebuild/spec
codebuild/spec
buildspec_ubuntu.yml
buildspec_ubuntu_integrationv2.yml
1:57 (81%)
1:56 (83%)
view
35 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
sampling.h
sampling.h
16:78 (100%)
16:78 (100%)
view
33 x 2 pq-crypto/bike_r1
pq-crypto/bike_r2
gf2x_mul.c
gf2x_mul.c
27:94 (100%)
27:94 (100%)
view
32 x 2 codebuild/spec
codebuild/spec
buildspec_ubuntu_integ_openssl102.yml
buildspec_ubuntu_integ_openssl102_asa...
1:48 (72%)
1:48 (72%)
view
32 x 2 pq-crypto/sike_r1
pq-crypto/sike_r3
ec_isogeny_r1.c
sikep434r3_ec_isogeny.c
213:251 (14%)
209:248 (14%)
view
32 x 2 pq-crypto/kyber_r3
pq-crypto/kyber_r3
S
kyber512r3_fq_avx2.S
kyber512r3_shuffle_avx2.S
1:36 (29%)
1:36 (14%)
view
30 x 2 pq-crypto/kyber_r3
pq-crypto/kyber_r3
S
kyber512r3_invntt_avx2.S
kyber512r3_shuffle_avx2.S
33:65 (14%)
4:36 (13%)
view
30 x 2 pq-crypto/kyber_r3
pq-crypto/kyber_r3
S
kyber512r3_fq_avx2.S
kyber512r3_invntt_avx2.S
4:36 (27%)
33:65 (14%)
view
29 x 2 tls
tls
s2n_cipher_preferences.c
s2n_cipher_preferences.c
1447:1475 (1%)
1548:1576 (1%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 33 unit duplicates...
Size#FoldersFilesLinesCode
27 x 2 pq-crypto/sike_r3
pq-crypto/sike_r1
sikep434r3_fp.c
fp_generic_r1.c
158:189 
102:133 
view
21 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
indcpa.c
indcpa.c
149:173 
149:173 
view
20 x 2 pq-crypto/sike_r3
pq-crypto/sike_r1
sikep434r3_ec_isogeny.c
ec_isogeny_r1.c
228:249 
229:252 
view
19 x 3 pq-crypto/bike_r3
pq-crypto/bike_r3
pq-crypto/bike_r3
gf2x_mul_avx2.c
gf2x_mul_avx512.c
gf2x_mul_portable.c
56:79 
56:79 
54:77 
view
16 x 3 pq-crypto/bike_r3
pq-crypto/bike_r3
pq-crypto/bike_r3
gf2x_mul_avx2.c
gf2x_mul_avx512.c
gf2x_mul_portable.c
18:37 
18:37 
16:35 
view
16 x 3 pq-crypto/bike_r3
pq-crypto/bike_r3
pq-crypto/bike_r3
gf2x_mul_avx2.c
gf2x_mul_avx512.c
gf2x_mul_portable.c
82:105 
82:105 
80:103 
view
14 x 3 pq-crypto/bike_r3
pq-crypto/bike_r3
pq-crypto/bike_r3
decode_portable.c
decode_avx2.c
decode_avx512.c
96:126 
139:169 
133:163 
view
13 x 2 pq-crypto/bike_r3
pq-crypto/bike_r3
gf2x_ksqr_avx512.c
gf2x_ksqr_avx2.c
111:131 
164:184 
view
12 x 3 pq-crypto/bike_r3
pq-crypto/bike_r3
pq-crypto/bike_r3
gf2x_mul_avx2.c
gf2x_mul_avx512.c
gf2x_mul_portable.c
39:54 
39:54 
37:52 
view
12 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
cbd.c
cbd.c
37:51 
37:51 
view
12 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
indcpa.c
indcpa.c
116:131 
116:131 
view
12 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
poly.c
poly.c
44:56 
44:56 
view
11 x 3 pq-crypto/bike_r3
pq-crypto/bike_r3
pq-crypto/bike_r3
decode_portable.c
decode_avx2.c
decode_avx512.c
82:94 
125:137 
119:131 
view
10 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
polyvec.c
polyvec.c
44:54 
44:54 
view
9 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
verify.c
verify.c
17:28 
17:28 
view
8 x 2 crypto
crypto
s2n_cbc_cipher_3des.c
s2n_cbc_cipher_aes.c
31:42 
36:47 
view
8 x 2 pq-crypto/sike_r3
pq-crypto/sike_r1
sikep434r3_fpx.c
fpx_r1.c
362:371 
76:85 
view
8 x 3 pq-crypto/bike_r3
pq-crypto/bike_r3
pq-crypto/bike_r3
decode_portable.c
decode_avx2.c
decode_avx512.c
70:79 
113:122 
107:116 
view
8 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
reduce.c
reduce.c
17:26 
17:26 
view
8 x 2 pq-crypto/kyber_r2
pq-crypto/kyber_90s_r2
poly.c
poly.c
246:255 
246:255 
view