kubernetes / kube-openapi
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
  • 9% duplication:
    • 8,204 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 820 duplicated lines
  • 59 duplicates
system9% (820 lines)
Duplication per Extension
go9% (820 lines)
Duplication per Component (primary)
pkg/validation5% (202 lines)
pkg/spec325% (128 lines)
pkg/builder37% (119 lines)
pkg/builder341% (119 lines)
pkg/generators7% (78 lines)
pkg/handler26% (69 lines)
pkg/schemamutation20% (63 lines)
pkg/schemaconv12% (36 lines)
pkg/handler34% (6 lines)
cmd/openapi2smd0% (0 lines)
cmd/openapi-gen0% (0 lines)
pkg/aggregator0% (0 lines)
pkg/util0% (0 lines)
pkg/internal0% (0 lines)
pkg/common0% (0 lines)
pkg/idl0% (0 lines)

Duplication Between Components (50+ lines)

G pkg/builder pkg/builder pkg/builder3 pkg/builder3 pkg/builder--pkg/builder3 238 pkg/spec3 pkg/spec3 pkg/validation pkg/validation pkg/spec3--pkg/validation 127 pkg/handler pkg/handler pkg/schemamutation pkg/schemamutation pkg/handler--pkg/schemamutation 126

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 59 duplicates...
Size#FoldersFilesLinesCode
19 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
362:383 (6%)
294:315 (6%)
view
19 x 2 pkg/generators
pkg/generators
openapi.go
openapi.go
728:750 (3%)
761:783 (3%)
view
17 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
394:411 (5%)
415:432 (6%)
view
17 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
303:322 (4%)
328:347 (4%)
view
17 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
303:322 (4%)
353:372 (4%)
view
17 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
403:422 (4%)
428:447 (4%)
view
17 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
378:397 (4%)
428:447 (4%)
view
17 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
103:131 (5%)
166:195 (6%)
view
17 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
328:347 (4%)
353:372 (4%)
view
17 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
378:397 (4%)
403:422 (4%)
view
15 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
259:273 (5%)
251:265 (5%)
view
14 x 2 pkg/spec3
pkg/validation/spec
path.go
paths.go
47:64 (20%)
36:53 (38%)
view
14 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
210:230 (4%)
205:228 (5%)
view
12 x 2 pkg/validation/spec
pkg/validation/spec
items.go
schema.go
40:51 (19%)
169:180 (4%)
view
11 x 2 pkg/spec3
pkg/spec3
header.go
parameter.go
69:89 (31%)
73:93 (29%)
view
10 x 2 pkg/schemaconv
pkg/schemaconv
smd.go
smd.go
121:130 (3%)
142:151 (3%)
view
10 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
183:201 (3%)
396:411 (3%)
view
9 x 2 pkg/handler
pkg/schemamutation
default_pruning.go
walker.go
65:78 (7%)
80:93 (2%)
view
9 x 2 pkg/handler
pkg/schemamutation
default_pruning.go
walker.go
80:93 (7%)
95:108 (2%)
view
8 x 2 pkg/handler
pkg/schemamutation
default_pruning.go
walker.go
126:137 (6%)
125:136 (2%)
view
Duplicated Units
The list of top 7 duplicated units.
See data for all 7 unit duplicates...
Size#FoldersFilesLinesCode
22 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
302:324 
327:349 
view
22 x 2 pkg/validation/errors
pkg/validation/errors
schema.go
schema.go
377:399 
402:424 
view
19 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
394:413 
415:434 
view
8 x 2 pkg/generators
pkg/generators
openapi.go
openapi.go
249:257 
259:267 
view
8 x 2 pkg/builder
pkg/builder3
util.go
util.go
53:61 
26:34 
view
6 x 2 pkg/builder
pkg/builder3
util.go
openapi.go
45:51 
42:48 
view
6 x 2 pkg/builder
pkg/builder3
openapi.go
openapi.go
197:203 
407:413 
view