kubernetes / kube-state-metrics
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
  • 26% duplication:
    • 6,902 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,829 duplicated lines
  • 2,012 duplicates
system26% (1,829 lines)
Duplication per Extension
go26% (1,829 lines)
Duplication per Component (primary)
internal/store31% (1,809 lines)
pkg/metricshandler14% (20 lines)
scripts0% (0 lines)
ROOT0% (0 lines)
pkg/customresource0% (0 lines)
pkg/sharding0% (0 lines)
pkg/metric_generator0% (0 lines)
pkg/options0% (0 lines)
pkg/app0% (0 lines)
pkg/allowdenylist0% (0 lines)
pkg/version0% (0 lines)
pkg/util0% (0 lines)
pkg/metric0% (0 lines)
pkg/allow0% (0 lines)
pkg/constant0% (0 lines)
pkg/optin0% (0 lines)
pkg/builder0% (0 lines)
pkg/watch0% (0 lines)
pkg/metrics_store0% (0 lines)
tools0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 2,012 duplicates...
Size#FoldersFilesLinesCode
54 x 2 internal/store
internal/store
node.go
node.go
255:310 (16%)
337:392 (16%)
view
39 x 2 internal/store
internal/store
pod.go
pod.go
158:208 (3%)
615:665 (3%)
view
39 x 2 internal/store
internal/store
pod.go
pod.go
221:270 (3%)
678:727 (3%)
view
23 x 2 internal/store
internal/store
pod.go
pod.go
161:184 (2%)
681:704 (2%)
view
23 x 2 internal/store
internal/store
pod.go
pod.go
618:641 (2%)
681:704 (2%)
view
23 x 2 internal/store
internal/store
pod.go
pod.go
224:247 (2%)
618:641 (2%)
view
23 x 2 internal/store
internal/store
pod.go
pod.go
161:184 (2%)
224:247 (2%)
view
23 x 2 internal/store
internal/store
job.go
pod.go
345:378 (7%)
1026:1059 (2%)
view
11 x 2 internal/store
internal/store
namespace.go
networkpolicy.go
85:97 (10%)
84:96 (10%)
view
11 x 2 internal/store
internal/store
persistentvolume.go
poddisruptionbudget.go
102:114 (5%)
67:79 (7%)
view
11 x 2 internal/store
internal/store
persistentvolumeclaim.go
poddisruptionbudget.go
67:79 (7%)
49:61 (7%)
view
11 x 2 internal/store
internal/store
cronjob.go
job.go
52:64 (4%)
51:63 (3%)
view
11 x 2 internal/store
internal/store
certificatesigningrequest.go
job.go
67:79 (9%)
69:81 (3%)
view
11 x 2 internal/store
internal/store
namespace.go
networkpolicy.go
67:79 (10%)
66:78 (10%)
view
11 x 2 internal/store
internal/store
horizontalpodautoscaler.go
verticalpodautoscaler.go
243:255 (5%)
71:83 (5%)
view
11 x 2 internal/store
internal/store
secret.go
statefulset.go
100:113 (9%)
210:222 (5%)
view
11 x 2 internal/store
internal/store
persistentvolume.go
persistentvolumeclaim.go
84:96 (5%)
67:79 (7%)
view
11 x 2 internal/store
internal/store
horizontalpodautoscaler.go
verticalpodautoscaler.go
225:237 (5%)
53:65 (5%)
view
11 x 2 internal/store
internal/store
certificatesigningrequest.go
cronjob.go
49:61 (9%)
52:64 (4%)
view
11 x 2 internal/store
internal/store
certificatesigningrequest.go
cronjob.go
67:79 (9%)
70:82 (4%)
view