kubernetes / cloud-provider-gcp
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
  • 29% duplication:
    • 26,516 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 7,829 duplicated lines
  • 1,236 duplicates
system29% (7,829 lines)
Duplication per Extension
yaml53% (6,014 lines)
go6% (655 lines)
in89% (410 lines)
sed89% (401 lines)
psm18% (298 lines)
ps121% (39 lines)
bzl9% (12 lines)
Duplication per Component (primary)
cluster/addons52% (5,232 lines)
cluster/gce32% (1,854 lines)
deploy100% (230 lines)
providers/gce3% (168 lines)
cmd/gcp-controller-manager6% (133 lines)
pkg/controller4% (56 lines)
pkg/credentialconfig26% (50 lines)
pkg/csrapproval25% (36 lines)
pkg/gcpcredential21% (27 lines)
cmd/gke-exec-auth-plugin4% (17 lines)
crd/config8% (14 lines)
defs9% (12 lines)
cmd/gke-gcloud-auth-plugin0% (0 lines)
cmd/auth-provider-gcp0% (0 lines)
cmd/cloud-controller-manager0% (0 lines)
pkg/nodeidentity0% (0 lines)
pkg/util0% (0 lines)
pkg/tpmattest0% (0 lines)
pkg/csrmetrics0% (0 lines)
tools0% (0 lines)
crd/client0% (0 lines)
crd/apis0% (0 lines)
cluster/log-dump0% (0 lines)

Duplication Between Components (50+ lines)

G cluster/addons cluster/addons cluster/gce cluster/gce cluster/addons--cluster/gce 516 deploy deploy cluster/addons--deploy 504 crd/config crd/config cluster/addons--crd/config 224 cluster/gce--deploy 122 defs defs cluster/gce--defs 60 pkg/credentialconfig pkg/credentialconfig providers/gce providers/gce pkg/credentialconfig--providers/gce 100 cmd/gcp-controller-manager cmd/gcp-controller-manager pkg/csrapproval pkg/csrapproval cmd/gcp-controller-manager--pkg/csrapproval 72 pkg/gcpcredential pkg/gcpcredential pkg/gcpcredential--providers/gce 54

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 1,236 duplicates...
Size#FoldersFilesLinesCode
654 x 2 cluster/addons/calico-policy-controller
cluster/addons/calico-policy-controller
globalnetworkpolicy-crd.yaml
networkpolicies-crd.yaml
45:698 (93%)
34:687 (86%)
view
329 x 2 cluster/addons/calico-policy-controller
cluster/addons/calico-policy-controller
networkpolicies-crd.yaml
networkpolicies-crd.yaml
36:364 (43%)
367:695 (43%)
view
329 x 2 cluster/addons/calico-policy-controller
cluster/addons/calico-policy-controller
globalnetworkpolicy-crd.yaml
networkpolicies-crd.yaml
47:375 (47%)
367:695 (43%)
view
321 x 2 cluster/addons/calico-policy-controller
cluster/addons/calico-policy-controller
globalnetworkpolicy-crd.yaml
networkpolicies-crd.yaml
378:698 (45%)
36:356 (42%)
view
321 x 2 cluster/addons/calico-policy-controller
cluster/addons/calico-policy-controller
globalnetworkpolicy-crd.yaml
globalnetworkpolicy-crd.yaml
47:367 (45%)
378:698 (45%)
view
178 x 2 cluster/addons/fluentd-gcp
cluster/addons/fluentd-gcp
fluentd-gcp-configmap-old.yaml
fluentd-gcp-configmap.yaml
102:343 (66%)
117:358 (62%)
view
162 x 2 cluster/addons/cloud-controller-manager
deploy
cloud-node-controller-role.yaml
cloud-node-controller-role.yaml
1:163 (100%)
1:163 (100%)
view
148 x 2 cluster/gce/gci
cluster/gce/ubuntu
master.yaml
master.yaml
3:178 (100%)
3:178 (100%)
view
148 x 2 cluster/gce/custom
cluster/gce/gci
master.yaml
master.yaml
3:178 (100%)
3:178 (100%)
view
148 x 2 cluster/gce/cos
cluster/gce/custom
master.yaml
master.yaml
3:178 (100%)
3:178 (100%)
view
148 x 2 cluster/gce/cos
cluster/gce/gci
master.yaml
master.yaml
3:178 (100%)
3:178 (100%)
view
148 x 2 cluster/gce/custom
cluster/gce/ubuntu
master.yaml
master.yaml
3:178 (100%)
3:178 (100%)
view
148 x 2 cluster/gce/cos
cluster/gce/ubuntu
master.yaml
master.yaml
3:178 (100%)
3:178 (100%)
view
107 x 2 cluster/gce/custom
cluster/gce/ubuntu
node.yaml
node.yaml
3:129 (100%)
3:129 (100%)
view
107 x 2 cluster/gce/custom
cluster/gce/gci
node.yaml
node.yaml
3:129 (100%)
3:129 (100%)
view
107 x 2 cluster/gce/gci
cluster/gce/ubuntu
node.yaml
node.yaml
3:129 (100%)
3:129 (100%)
view
107 x 2 cluster/gce/cos
cluster/gce/ubuntu
node.yaml
node.yaml
3:129 (100%)
3:129 (100%)
view
107 x 2 cluster/gce/cos
cluster/gce/custom
node.yaml
node.yaml
3:129 (100%)
3:129 (100%)
view
107 x 2 cluster/gce/cos
cluster/gce/gci
node.yaml
node.yaml
3:129 (100%)
3:129 (100%)
view
104 x 2 cluster/addons/calico-policy-controller
cluster/addons/calico-policy-controller
globalnetworkpolicy-crd.yaml
networkpolicies-crd.yaml
268:371 (14%)
52:155 (13%)
view
Duplicated Units
The list of top 9 duplicated units.
See data for all 9 unit duplicates...
Size#FoldersFilesLinesCode
29 x 2 pkg/credentialconfig
providers/gce/gcpcredential
config.go
credentialutil.go
192:225 
48:81 
view
22 x 4 cluster/gce/ubuntu/mounter
cluster/gce/cos/mounter
cluster/gce/custom/mounter
cluster/gce/gci/mounter
mounter.go
mounter.go
mounter.go
mounter.go
37:61 
37:61 
37:61 
37:61 
view
21 x 4 cluster/gce/ubuntu/mounter
cluster/gce/cos/mounter
cluster/gce/custom/mounter
cluster/gce/gci/mounter
mounter.go
mounter.go
mounter.go
mounter.go
64:93 
64:93 
64:93 
64:93 
view
18 x 2 pkg/credentialconfig
providers/gce/gcpcredential
config.go
registry_marshal.go
296:324 
76:104 
view
14 x 2 cmd/gcp-controller-manager
pkg/csrapproval
node_csr_approver.go
csrapproval.go
272:289 
262:279 
view
13 x 2 providers/gce
providers/gce
gce_loadbalancer_external.go
gce_loadbalancer_internal.go
659:672 
765:778 
view
9 x 2 cmd/gcp-controller-manager
cmd/gcp-controller-manager
istiod_csr_approver.go
oidc_csr_approver.go
78:87 
72:81 
view
8 x 2 cmd/gcp-controller-manager
cmd/gcp-controller-manager
istiod_csr_approver.go
oidc_csr_approver.go
68:76 
62:70 
view
7 x 2 pkg/controller/nodeipam/config/v1alpha1
pkg/controller/nodeipam/config/v1alpha1
zz_generated.conversion.go
zz_generated.conversion.go
84:91 
93:100 
view