kubernetes / kubectl
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
  • 42% duplication:
    • 53,599 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 22,584 duplicated lines
  • 3,367 duplicates
system42% (22,584 lines)
Duplication per Extension
po78% (19,272 lines)
go11% (3,312 lines)
Duplication per Component (primary)
pkg/util73% (19,371 lines)
pkg/cmd12% (2,365 lines)
pkg/describe15% (600 lines)
pkg/polymorphichelpers16% (193 lines)
pkg/apply3% (31 lines)
pkg/generate2% (12 lines)
pkg/drain2% (12 lines)
pkg/metricsutil0% (0 lines)
pkg/proxy0% (0 lines)
pkg/explain0% (0 lines)
pkg/scale0% (0 lines)
pkg/apps0% (0 lines)
pkg/scheme0% (0 lines)
pkg/rawhttp0% (0 lines)
pkg/validation0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G pkg/cmd pkg/cmd pkg/util pkg/util pkg/cmd--pkg/util 162

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 3,367 duplicates...
Size#FoldersFilesLinesCode
4731 x 2 pkg/util/i18n/translatio...ctl/default/LC_MESSAGES
pkg/util/i18n/translatio...bectl/en_US/LC_MESSAGES
po
k8s.po
k8s.po
19:5085 (99%)
19:5085 (99%)
view
265 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
1746:2017 (8%)
1694:1965 (8%)
view
197 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
2167:2370 (6%)
2115:2318 (6%)
view
97 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
2066:2165 (3%)
2014:2113 (3%)
view
70 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
2455:2525 (2%)
2403:2473 (2%)
view
69 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
po
k8s.po
k8s.po
2476:2545 (2%)
2408:2477 (2%)
view
67 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
2659:2727 (2%)
2590:2658 (2%)
view
60 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
po
k8s.po
k8s.po
2245:2304 (1%)
2176:2235 (1%)
view
60 x 2 pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
2176:2235 (1%)
2193:2252 (1%)
view
59 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
2560:2619 (1%)
2499:2558 (1%)
view
56 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
300:361 (1%)
299:360 (1%)
view
53 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
3017:3073 (1%)
2940:2996 (1%)
view
52 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
po
k8s.po
k8s.po
2547:2599 (1%)
2479:2531 (1%)
view
51 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
2936:2987 (1%)
2859:2910 (1%)
view
50 x 2 pkg/util/i18n/translatio...bectl/ja_JP/LC_MESSAGES
pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
po
k8s.po
k8s.po
1775:1825 (1%)
1708:1758 (1%)
view
50 x 2 pkg/util/i18n/translatio...bectl/de_DE/LC_MESSAGES
pkg/util/i18n/translatio...bectl/it_IT/LC_MESSAGES
po
k8s.po
k8s.po
1623:1673 (1%)
1706:1756 (1%)
view
50 x 2 pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
1708:1758 (1%)
1723:1773 (1%)
view
50 x 2 pkg/util/i18n/translatio...bectl/it_IT/LC_MESSAGES
pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
po
k8s.po
k8s.po
1706:1756 (1%)
1708:1758 (1%)
view
50 x 2 pkg/util/i18n/translatio...bectl/de_DE/LC_MESSAGES
pkg/util/i18n/translatio...bectl/zh_CN/LC_MESSAGES
po
k8s.po
k8s.po
1623:1673 (1%)
1723:1773 (1%)
view
50 x 2 pkg/util/i18n/translatio...bectl/de_DE/LC_MESSAGES
pkg/util/i18n/translatio...bectl/pt_BR/LC_MESSAGES
po
k8s.po
k8s.po
1623:1673 (1%)
1708:1758 (1%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 26 unit duplicates...
Size#FoldersFilesLinesCode
41 x 4 pkg/cmd/create
pkg/cmd/create
pkg/cmd/create
pkg/cmd/create
create_secret_tls.go
create_secret.go
create_secret_docker.go
create_configmap.go
120:172 
164:216 
163:215 
148:199 
view
34 x 2 pkg/cmd/set/env
pkg/util/fieldpath
env_resolve.go
fieldpath.go
93:130 
48:85 
view
34 x 2 pkg/cmd/set/env
pkg/util/resource
env_resolve.go
resource.go
180:217 
89:126 
view
34 x 2 pkg/util/fieldpath
pkg/cmd/set/env
fieldpath.go
env_resolve.go
48:85 
93:130 
view
25 x 2 pkg/describe
pkg/describe
describe.go
describe.go
4680:4708 
4710:4738 
view
24 x 2 pkg/describe
pkg/describe
describe.go
describe.go
2335:2359 
2400:2424 
view
20 x 2 pkg/describe
pkg/describe
describe.go
describe.go
2780:2801 
2803:2824 
view
17 x 2 pkg/polymorphichelpers
pkg/polymorphichelpers
history.go
history.go
264:282 
285:303 
view
15 x 2 pkg/cmd/run
pkg/cmd/debug
run.go
debug.go
511:528 
798:815 
view
13 x 2 pkg/cmd/set/env
pkg/util/fieldpath
env_resolve.go
fieldpath.go
143:156 
98:111 
view
12 x 2 pkg/cmd/attach
pkg/cmd/exec
attach.go
exec.go
156:168 
118:130 
view
11 x 2 pkg/describe
pkg/describe
describe.go
describe.go
1132:1143 
1145:1156 
view
11 x 2 pkg/describe
pkg/polymorphichelpers
describe.go
history.go
5234:5247 
388:401 
view
10 x 2 pkg/cmd/set/env
pkg/util/fieldpath
env_resolve.go
fieldpath.go
159:171 
31:43 
view
10 x 2 pkg/describe
pkg/describe
describe.go
describe.go
4893:4903 
4905:4915 
view
9 x 2 pkg/apply
pkg/apply
type_element.go
map_element.go
44:53 
75:84 
view
9 x 2 pkg/describe
pkg/describe
describe.go
describe.go
1253:1262 
1264:1273 
view
9 x 2 pkg/describe
pkg/describe
describe.go
describe.go
2734:2743 
2745:2754 
view
8 x 2 pkg/cmd/create
pkg/cmd/create
create_secret.go
create_configmap.go
219:227 
202:210 
view
8 x 2 pkg/apply/strategy
pkg/apply/strategy
merge_visitor.go
merge_visitor.go
77:87 
90:100 
view