tensorflow / swift-models
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
  • 8% duplication:
    • 23,413 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,013 duplicated lines
  • 113 duplicates
system8% (2,013 lines)
Duplication per Extension
swift10% (1,785 lines)
h4% (228 lines)
Duplication per Component (primary)
Models10% (535 lines)
Checkpoints22% (287 lines)
TensorBoard19% (278 lines)
Support4% (266 lines)
Datasets10% (237 lines)
pix2pix13% (76 lines)
CycleGAN18% (76 lines)
Gym7% (68 lines)
SwiftModelsBenchmarksCore6% (66 lines)
Autoencoder17% (36 lines)
TrainingLoop5% (34 lines)
FastStyleTransfer17% (28 lines)
MiniGo2% (26 lines)
DCGAN0% (0 lines)
GAN0% (0 lines)
cmake0% (0 lines)
PersonLab0% (0 lines)
ImageLoader0% (0 lines)
SwiftModelsBenchmarks0% (0 lines)
ROOT0% (0 lines)
Catch0% (0 lines)

Duplication Between Components (50+ lines)

G Checkpoints Checkpoints TensorBoard TensorBoard Checkpoints--TensorBoard 565 CycleGAN CycleGAN pix2pix pix2pix CycleGAN--pix2pix 152

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 113 duplicates...
Size#FoldersFilesLinesCode
26 x 2 Models/ImageClassification
Models/ImageClassification
MobileNetV3.swift
MobileNetV3.swift
321:349 (6%)
440:468 (6%)
view
26 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
100:128 (10%)
92:120 (11%)
view
24 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
155:181 (9%)
141:167 (10%)
view
22 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
25:68 (8%)
25:68 (9%)
view
22 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
274:295 (8%)
248:269 (9%)
view
21 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
219:239 (8%)
199:219 (9%)
view
21 x 2 Models/Text/BERT
Models/Text/BERT
TransformerBERT.swift
TransformerBERT.swift
89:109 (11%)
235:255 (11%)
view
20 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
299:318 (7%)
270:289 (8%)
view
20 x 2 Gym/DQN
Gym/PPO
Gathering.swift
Gathering.swift
17:43 (100%)
17:43 (100%)
view
20 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
77:96 (7%)
72:91 (8%)
view
20 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
185:204 (7%)
168:187 (8%)
view
20 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
132:151 (7%)
121:140 (8%)
view
20 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
types.pb.swift
types.pb.swift
243:262 (7%)
220:239 (8%)
view
19 x 2 SwiftModelsBenchmarksCore/Layers
SwiftModelsBenchmarksCore/Layers
LayerSuite.swift
LayerSuite.swift
35:55 (16%)
85:105 (16%)
view
17 x 2 Models/ImageClassification
Models/ImageClassification
BigTransfer.swift
ResNetV2.swift
346:366 (7%)
178:198 (13%)
view
17 x 2 Checkpoints
TensorBoard
CheckpointReader.swift
Support.swift
325:350 (8%)
45:70 (42%)
view
16 x 2 Models/ImageClassification
Models/ImageClassification
MobileNetV3.swift
MobileNetV3.swift
252:271 (4%)
381:400 (4%)
view
16 x 2 Datasets/Imagenette
Datasets/Imagenette
Imagenette.swift
Imagewoof.swift
41:87 (12%)
26:72 (34%)
view
16 x 2 Models/ImageClassification
Models/ImageClassification
MobileNetV2.swift
MobileNetV3.swift
22:42 (9%)
22:42 (4%)
view
15 x 2 CycleGAN/Models
pix2pix
Layers.swift
Layers.swift
21:54 (21%)
30:63 (11%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
13 x 2 Checkpoints
TensorBoard
CheckpointReader.swift
Support.swift
329:344 
49:64 
view
12 x 2 Gym/DQN
Gym/PPO
Gathering.swift
Gathering.swift
32:44 
32:44 
view
8 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
tensor_shape.pb.swift
tensor_shape.pb.swift
97:105 
101:109 
view
8 x 2 Checkpoints/Protobufs
TensorBoard/Protobufs
tensor_shape.pb.swift
tensor_shape.pb.swift
132:140 
139:147 
view