kubernetes / cli-runtime
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
  • 6% duplication:
    • 3,490 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 244 duplicated lines
  • 16 duplicates
system6% (244 lines)
Duplication per Extension
go4% (149 lines)
yaml39% (95 lines)
Duplication per Component (primary)
pkg/resource6% (109 lines)
artifacts/guestbook51% (49 lines)
artifacts58% (46 lines)
pkg/printers3% (26 lines)
pkg/genericclioptions1% (14 lines)
artifacts/kustomization0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G artifacts/guestbook artifacts/guestbook artifacts artifacts artifacts/guestbook--artifacts 59

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 16 longest duplicates.
See data for all 16 duplicates...
Size#FoldersFilesLinesCode
26 x 2 artifacts/guestbook
artifacts
redis-master-controller.yaml
redis-master-controller.yaml
1:26 (100%)
1:26 (100%)
view
13 x 2 artifacts
artifacts
deeply-nested.yaml
deeply-nested.yaml
2:14 (61%)
9:21 (61%)
view
10 x 2 pkg/resource
pkg/resource
mapper.go
mapper.go
53:66 (13%)
99:112 (13%)
view
9 x 2 pkg/resource
pkg/resource
builder.go
builder.go
996:1005 (1%)
1058:1067 (1%)
view
9 x 2 pkg/resource
pkg/resource
visitor.go
visitor.go
614:625 (2%)
634:644 (2%)
view
9 x 2 pkg/resource
pkg/resource
visitor.go
visitor.go
210:220 (2%)
356:366 (2%)
view
8 x 2 artifacts/guestbook
artifacts/guestbook
frontend-controller.yaml
redis-slave-controller.yaml
16:28 (33%)
21:33 (27%)
view
7 x 2 artifacts/guestbook
artifacts/guestbook
redis-master-controller.yaml
redis-master-service.yaml
3:9 (26%)
3:9 (43%)
view
7 x 2 pkg/printers
pkg/printers
json.go
yaml.go
42:49 (21%)
56:63 (20%)
view
7 x 2 artifacts/guestbook
artifacts
redis-master-service.yaml
redis-master-controller.yaml
3:9 (43%)
3:9 (26%)
view
7 x 2 pkg/genericclioptions
pkg/genericclioptions
jsonpath_flags.go
template_flags.go
71:79 (12%)
72:80 (12%)
view
7 x 2 pkg/resource
pkg/resource
builder.go
builder.go
905:912 (1%)
1052:1060 (1%)
view
6 x 2 pkg/resource
pkg/resource
client.go
client.go
34:41 (20%)
50:57 (20%)
view
6 x 2 pkg/resource
pkg/resource
mapper.go
mapper.go
69:78 (8%)
115:124 (8%)
view
6 x 2 pkg/printers
pkg/printers
tableprinter.go
tableprinter.go
181:187 (1%)
202:208 (1%)
view
6 x 2 artifacts
artifacts
deeply-nested.yaml
deeply-nested.yaml
2:7 (28%)
16:21 (28%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
8 x 2 pkg/genericclioptions
pkg/genericclioptions
jsonpath_flags.go
template_flags.go
120:128 
116:124 
view