facebookincubator / contest
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
  • 3% duplication:
    • 9,131 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 349 duplicated lines
  • 42 duplicates
system3% (349 lines)
Duplication per Extension
go3% (335 lines)
sql9% (14 lines)
Duplication per Component (primary)
pkg/xcontext5% (93 lines)
pkg/userfunctions52% (63 lines)
plugins/teststeps2% (50 lines)
pkg/event26% (42 lines)
pkg/api6% (21 lines)
plugins/targetlocker3% (16 lines)
pkg/runner2% (12 lines)
pkg/pluginregistry6% (12 lines)
pkg/storage5% (12 lines)
docker/mariadb70% (7 lines)
docker/mysql70% (7 lines)
db/rdbms2% (7 lines)
pkg/job3% (7 lines)
ROOT0% (0 lines)
tools0% (0 lines)
tools/migration0% (0 lines)
plugins/storage0% (0 lines)
plugins/targetmanagers0% (0 lines)
plugins/reporters0% (0 lines)
plugins/testfetchers0% (0 lines)
plugins/listeners0% (0 lines)
cmds/clients0% (0 lines)
cmds/exec_agent0% (0 lines)
cmds/contest-generator0% (0 lines)
cmds/contest0% (0 lines)
pkg/jobmanager0% (0 lines)
pkg/types0% (0 lines)
pkg/transport0% (0 lines)
pkg/config0% (0 lines)
pkg/cerrors0% (0 lines)
pkg/lib0% (0 lines)
pkg/logging0% (0 lines)
Longest Duplicates
The list of 42 longest duplicates.
See data for all 42 duplicates...
Size#FoldersFilesLinesCode
14 x 2 pkg/event/frameworkevent
pkg/event/testevent
69:94 (31%)
93:118 (18%)
view
13 x 2 plugins/teststeps/echo
plugins/teststeps/randecho
23:54 (52%)
26:57 (37%)
view
11 x 2 pkg/xcontext/metrics/simplemetrics
pkg/xcontext/metrics/simplemetrics
25:39 (37%)
25:38 (37%)
view
11 x 2 pkg/xcontext/metrics/simplemetrics
pkg/xcontext/metrics/simplemetrics
25:38 (37%)
25:38 (37%)
view
11 x 2 pkg/xcontext/metrics/simplemetrics
pkg/xcontext/metrics/simplemetrics
25:39 (37%)
25:38 (37%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
49:59 (7%)
134:144 (7%)
view
9 x 2 pkg/xcontext/logger/logadapter/logrus
pkg/xcontext/logger/logadapter/zap
14:29 (20%)
17:32 (20%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
31:41 (7%)
134:144 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
31:41 (7%)
100:110 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
66:76 (7%)
134:144 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
31:41 (7%)
117:127 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
49:59 (7%)
66:76 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
66:76 (7%)
117:127 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
117:127 (7%)
134:144 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
31:41 (7%)
66:76 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
83:93 (7%)
117:127 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
49:59 (7%)
83:93 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
66:76 (7%)
100:110 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
100:110 (7%)
117:127 (7%)
view
9 x 2 pkg/xcontext
pkg/xcontext
268:281 (4%)
292:305 (4%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
83:93 (7%)
100:110 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
100:110 (7%)
134:144 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
31:41 (7%)
83:93 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
66:76 (7%)
83:93 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
49:59 (7%)
100:110 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
49:59 (7%)
117:127 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
83:93 (7%)
134:144 (7%)
view
9 x 2 pkg/userfunctions/ocp
pkg/userfunctions/ocp
31:41 (7%)
49:59 (7%)
view
8 x 2 plugins/targetlocker/inmemory
plugins/targetlocker/inmemory
106:115 (5%)
127:136 (5%)
view
7 x 2 pkg/api
pkg/api
198:205 (4%)
221:228 (4%)
view
7 x 2 db/rdbms/migration
pkg/job
47:53 (3%)
15:23 (87%)
view
7 x 2 docker/mariadb
docker/mysql
15:23 (70%)
15:23 (70%)
view
7 x 2 pkg/api
pkg/api
221:228 (4%)
246:253 (4%)
view
7 x 2 pkg/event/frameworkevent
pkg/event/testevent
54:66 (15%)
75:87 (9%)
view
7 x 2 pkg/api
pkg/api
198:205 (4%)
246:253 (4%)
view
6 x 2 pkg/xcontext/metrics/prometheus
pkg/xcontext/metrics/prometheus
22:27 (26%)
22:27 (26%)
view
6 x 2 pkg/xcontext/metrics/prometheus
pkg/xcontext/metrics/prometheus
354:361 (2%)
381:388 (2%)
view
6 x 2 pkg/pluginregistry
pkg/pluginregistry
102:110 (8%)
122:130 (8%)
view
6 x 2 pkg/runner
pkg/runner
315:321 (2%)
353:359 (2%)
view
6 x 2 pkg/storage
pkg/storage
62:68 (11%)
87:93 (11%)
view
6 x 2 plugins/teststeps/cmd
plugins/teststeps/s3fileupload
83:89 (5%)
73:79 (3%)
view
6 x 2 plugins/teststeps/exec
plugins/teststeps/exec
35:40 (8%)
73:78 (8%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
14 x 2 plugins/teststeps/cmd
plugins/teststeps/s3fileupload
78:93 
68:83 
view