microsoft / envoy
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
  • 2% duplication:
    • 80,108 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,366 duplicated lines
  • 203 duplicates
system2% (2,366 lines)
Duplication per Extension
cc2% (1,053 lines)
h2% (640 lines)
yaml34% (353 lines)
proto2% (224 lines)
bzl4% (96 lines)
Duplication per Component (primary)
source/extensions3% (843 lines)
source/common2% (817 lines)
configs31% (336 lines)
api/envoy2% (224 lines)
api/bazel18% (80 lines)
include/envoy<1% (25 lines)
source/server<1% (24 lines)
configs/freebind32% (11 lines)
configs/original-dst-cluster14% (6 lines)
api/tools0% (0 lines)
bazel0% (0 lines)
ci0% (0 lines)
restarter0% (0 lines)
source/exe0% (0 lines)
tools0% (0 lines)
tools/deprecate_version0% (0 lines)
tools/envoy_collect0% (0 lines)
tools/protodoc0% (0 lines)
windows/setup0% (0 lines)

Duplication Between Components (50+ lines)

G source/common source/common source/extensions source/extensions source/common--source/extensions 154 include/envoy include/envoy include/envoy--source/extensions 50

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 203 duplicates...
Size#FoldersFilesLinesCode
44 x 2 source/extensions/filters/network/thrift_proxy
source/extensions/filters/network/thrift_proxy
binary_protocol_impl.h
compact_protocol_impl.h
26:69 (67%)
29:72 (54%)
view
24 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
306:331 (1%)
1514:1539 (1%)
view
24 x 2 configs
configs
envoy_service_to_service_v2.template....
envoy_service_to_service_v2.template....
122:145 (4%)
176:199 (4%)
view
22 x 2 configs
configs
envoy_double_proxy_v2.template.yaml
envoy_front_proxy_v2.template.yaml
53:74 (14%)
60:81 (15%)
view
21 x 2 source/common/router
source/extensions/filter...ork/thrift_proxy/router
router_ratelimit.cc
router_ratelimit_impl.cc
90:110 (20%)
93:113 (19%)
view
19 x 2 source/extensions/filter...ork/dubbo_proxy/filters
source/extensions/filter...rk/thrift_proxy/filters
factory_base.h
factory_base.h
19:44 (76%)
14:39 (76%)
view
18 x 2 source/extensions/filters/network/thrift_proxy
source/extensions/filters/network/thrift_proxy
conn_manager.h
thrift_object_impl.h
181:198 (9%)
28:45 (11%)
view
14 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
545:560 (<1%)
735:749 (<1%)
view
14 x 2 source/common/ssl
source/common/ssl
context_config_impl.cc
context_config_impl.cc
245:260 (5%)
309:324 (5%)
view
13 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
612:624 (<1%)
761:773 (<1%)
view
13 x 2 configs
configs
envoy_service_to_service_v2.template....
envoy_service_to_service_v2.template....
58:70 (2%)
254:266 (2%)
view
13 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
599:612 (<1%)
736:749 (<1%)
view
13 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
546:560 (<1%)
599:612 (<1%)
view
13 x 2 source/extensions/access_loggers/file
source/extensions/access_loggers/http_grpc
file_access_log_impl.cc
grpc_access_log_impl.cc
18:34 (52%)
161:177 (5%)
view
12 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
529:541 (<1%)
737:749 (<1%)
view
12 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
529:541 (<1%)
600:612 (<1%)
view
12 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
529:541 (<1%)
547:560 (<1%)
view
12 x 2 source/common/upstream
source/common/upstream
logical_dns_cluster.cc
upstream_impl.cc
45:56 (11%)
1201:1212 (1%)
view
11 x 2 configs
configs
envoy_service_to_service_v2.template....
envoy_service_to_service_v2.template....
180:190 (2%)
250:260 (2%)
view
11 x 2 configs/freebind
configs
freebind.yaml
google_com_proxy.v2.yaml
12:22 (32%)
16:26 (25%)
view
Duplicated Units
The list of top 9 duplicated units.
See data for all 9 unit duplicates...
Size#FoldersFilesLinesCode
12 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
1187:1199 
1627:1639 
view
9 x 2 source/common/json
source/common/json
config_schemas.cc
config_schemas.cc
931:940 
943:952 
view
9 x 2 source/common/stats
source/common/stats
stat_data_allocator_impl.h
stat_data_allocator_impl.h
171:180 
183:192 
view
9 x 2 source/extensions/filters/network/thrift_proxy
source/extensions/filters/network/thrift_proxy
thrift_object_impl.cc
thrift_object_impl.cc
166:177 
202:213 
view
8 x 2 source/extensions/filters/network/ext_authz
source/extensions/filters/network/ratelimit
ext_authz.cc
ratelimit.cc
49:59 
59:69 
view
7 x 2 source/extensions/filters/http/grpc_http1_bridge
source/extensions/filters/http/grpc_web
http1_bridge_filter.cc
grpc_web_filter.cc
97:104 
218:225 
view
7 x 2 source/extensions/filters/network/thrift_proxy
source/extensions/filters/network/thrift_proxy
binary_protocol_impl.cc
compact_protocol_impl.cc
216:225 
339:348 
view
6 x 2 source/extensions/filters/network/thrift_proxy
source/extensions/filters/network/thrift_proxy
binary_protocol_impl.cc
compact_protocol_impl.cc
184:190 
279:285 
view
6 x 2 source/extensions/filters/network/thrift_proxy
source/extensions/filters/network/thrift_proxy
twitter_protocol_impl.cc
twitter_protocol_impl.cc
526:532 
914:920 
view