microsoft / CCF
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
  • 7% duplication:
    • 43,430 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,108 duplicated lines
  • 253 duplicates
system7% (3,108 lines)
Duplication per Extension
h4% (1,400 lines)
cpp13% (979 lines)
tla42% (664 lines)
yml11% (53 lines)
py<1% (12 lines)
Duplication per Component (primary)
src6% (2,288 lines)
tla40% (664 lines)
include6% (91 lines)
getting_started11% (53 lines)
python<1% (12 lines)
cmake0% (0 lines)
doc0% (0 lines)
js0% (0 lines)
ROOT0% (0 lines)
scripts0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 253 duplicates...
Size#FoldersFilesLinesCode
101 x 2 src/apps/js_generic
src/apps/js_v8
js_generic_base.cpp
js_v8_base.cpp
445:623 (25%)
309:487 (32%)
view
44 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
85:135 (5%)
55:105 (6%)
view
37 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
141:184 (4%)
115:158 (5%)
view
31 x 2 src/node/rpc
src/node/rpc
node_frontend.h
node_frontend.h
420:461 (2%)
514:556 (2%)
view
31 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
653:685 (3%)
453:485 (4%)
view
31 x 2 src/apps/js_generic
src/apps/js_v8
named_auth_policies.h
named_auth_policies.h
9:56 (67%)
9:56 (67%)
view
23 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
504:527 (2%)
342:365 (3%)
view
21 x 2 src/apps/tpcc/app
src/apps/tpcc/app
tpcc_tables.h
tpcc_tables.h
268:288 (5%)
295:315 (5%)
view
20 x 2 src/http/authentication
src/http/authentication
sig_auth.h
sig_auth.h
114:143 (12%)
228:257 (12%)
view
20 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
365:384 (2%)
286:305 (3%)
view
19 x 2 src/node
src/node
channels.h
channels.h
340:368 (3%)
449:477 (3%)
view
18 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
297:314 (2%)
229:246 (2%)
view
18 x 2 include/ccf
include/ccf
historical_queries_adapter.h
historical_queries_adapter.h
212:237 (8%)
278:306 (8%)
view
17 x 2 src/node/rpc
src/node/rpc
member_frontend.h
member_frontend.h
1149:1169 (1%)
1199:1219 (1%)
view
17 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
568:584 (2%)
403:419 (2%)
view
17 x 2 tla/raft_spec
tla/reduced_raft_spec
tla
ccfraft.tla
ccfraft.tla
1:19 (2%)
1:19 (2%)
view
16 x 2 src/js
src/js
wrap.cpp
wrap.cpp
503:526 (1%)
892:915 (1%)
view
15 x 2 src/apps/js_v8/tmpl
src/apps/js_v8/tmpl
ccf_global.cpp
ccf_global.cpp
493:513 (3%)
549:569 (3%)
view
15 x 2 src/node
src/node
historical_queries.h
historical_queries.h
352:368 (2%)
398:414 (2%)
view
14 x 2 getting_started/setup_vm
getting_started/setup_vm
app-dev.yml
ccf-dev.yml
4:17 (63%)
2:15 (53%)
view
Duplicated Units
The list of top 16 duplicated units.
See data for all 16 unit duplicates...
Size#FoldersFilesLinesCode
65 x 2 src/apps/js_generic
src/apps/js_v8
js_generic_base.cpp
js_v8_base.cpp
462:544 
326:408 
view
26 x 2 src/apps/js_generic
src/apps/js_v8
js_generic_base.cpp
js_v8_base.cpp
546:578 
410:442 
view
15 x 2 src/apps/js_v8/tmpl
src/js
ccf_global.cpp
crypto.cpp
362:377 
148:163 
view
14 x 2 src/http/authentication
src/http/authentication
sig_auth.h
sig_auth.h
122:136 
236:250 
view
12 x 2 src/apps/js_generic
src/apps/js_v8
js_generic_base.cpp
js_v8_base.cpp
448:460 
312:324 
view
12 x 2 src/apps/js_v8/tmpl
src/apps/js_v8/tmpl
request_authn_identity.cpp
request_authn_identity.cpp
134:150 
199:215 
view
11 x 2 src/apps/js_generic
src/apps/js_v8
js_generic_base.cpp
js_v8_base.cpp
580:592 
444:456 
view
11 x 2 src/js
src/js
wrap.h
wrap.h
456:467 
469:480 
view
10 x 2 src/apps/js_generic
src/apps/js_v8
named_auth_policies.h
named_auth_policies.h
43:54 
43:54 
view
9 x 2 src/ds
src/ds
serializer.h
serializer.h
398:408 
459:469 
view
9 x 2 src/ds
src/ds
serializer.h
serializer.h
411:421 
472:482 
view
8 x 2 src/apps/js_v8/tmpl
src/apps/js_v8/tmpl
console_global.cpp
crypto.cpp
52:63 
156:167 
view
8 x 2 src/crypto/openssl
src/crypto/openssl
key_pair.cpp
rsa_key_pair.cpp
64:74 
92:102 
view
8 x 2 src/kv
src/kv
map_handle.h
set_handle.h
162:170 
64:72 
view
7 x 2 src/enclave
src/http
rpc_sessions.h
http_endpoint.h
72:80 
38:46 
view
6 x 2 src/host
src/host
node_connections.h
node_connections.h
169:175 
177:183 
view