apple / swift-distributed-actors
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
  • 10% duplication:
    • 25,777 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,618 duplicated lines
  • 625 duplicates
system10% (2,618 lines)
Duplication per Extension
swift9% (2,454 lines)
proto34% (164 lines)
Duplication per Component (primary)
Sources/DistributedActors10% (2,005 lines)
Sources/DistributedActorsBenchmarks29% (308 lines)
Sources/DistributedActorsTestKit4% (69 lines)
Protos/Cluster34% (68 lines)
Sources/DistributedActorsGenerator4% (64 lines)
Protos30% (51 lines)
ROOT11% (24 lines)
Protos/Serialization80% (16 lines)
Protos/Clocks25% (13 lines)
Models0% (0 lines)
Plugins/DistributedActorsGeneratorPlugin0% (0 lines)
Sources/ActorSingletonPlugin0% (0 lines)
Sources/CDistributedActorsMailbox0% (0 lines)
Sources/DistributedActorsConcurrencyHelpers0% (0 lines)
Sources/SwiftBenchmarkTools0% (0 lines)
docker0% (0 lines)

Duplication Between Components (50+ lines)

G Sources/DistributedActors Sources/DistributedActors Sources/DistributedActorsBenchmarks Sources/DistributedActorsBenchmarks Sources/DistributedActors--Sources/DistributedActorsBenchmarks 186 Protos/Cluster Protos/Cluster Protos Protos Protos/Cluster--Protos 83 Protos/Cluster--Sources/DistributedActorsBenchmarks 55 Protos/Serialization Protos/Serialization Protos/Cluster--Protos/Serialization 55 Protos--Sources/DistributedActorsBenchmarks 64 Protos/Serialization--Protos 64 Protos/Clocks Protos/Clocks Protos/Clocks--Protos/Cluster 60

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 625 duplicates...
Size#FoldersFilesLinesCode
31 x 2 Sources/DistributedActors/Clocks/Protobuf
Sources/DistributedActors/Clocks/Protobuf
VersionVector.pb.swift
VersionVector.pb.swift
405:453 (8%)
503:551 (8%)
view
31 x 2 Sources/DistributedActors/Protobuf
Sources/DistributedActors/Protobuf
SystemMessages.pb.swift
SystemMessages.pb.swift
332:380 (8%)
401:449 (8%)
view
30 x 2 Sources/DistributedActors/Serialization
Sources/DistributedActors/Serialization
TopLevelBytesBlobCoders.swift
TopLevelProtobufCoders.swift
25:78 (23%)
24:77 (19%)
view
30 x 2 Sources/DistributedActors/Serialization
Sources/DistributedActors/Serialization
TopLevelBytesBlobCoders.swift
TopLevelProtobufCoders.swift
214:271 (23%)
243:300 (19%)
view
30 x 2 Sources/DistributedActors/Serialization
Sources/DistributedActors/Serialization
TopLevelBytesBlobCoders.swift
TopLevelProtobufCoders.swift
112:169 (23%)
111:168 (19%)
view
29 x 2 Sources/DistributedActors/Concurrency
Sources/DistributedActorsBenchmarks/Concurrency
locks.swift
_BlockingReceptacle.swift
126:172 (22%)
19:65 (100%)
view
28 x 2 Sources/DistributedActors/Concurrency
Sources/DistributedActorsBenchmarks/Concurrency
CountDownLatch.swift
CountDownLatch.swift
17:64 (100%)
18:65 (100%)
view
28 x 2 Sources/DistributedActors/Protobuf
Sources/DistributedActors/Protobuf
WireProtocol.pb.swift
WireProtocol.pb.swift
356:400 (5%)
514:558 (5%)
view
25 x 2 Sources/DistributedActorsBenchmarks
Sources/DistributedActorsBenchmarks
ActorPingPongBenchmarks.swift
ActorRemotePingPongBenchmarks.swift
186:222 (15%)
175:211 (16%)
view
21 x 2 Sources/DistributedActors/Receptionist
Sources/DistributedActors/Receptionist
DistributedReception.swift
Receptionist.swift
98:132 (35%)
452:486 (8%)
view
19 x 2 Sources/DistributedActorsBenchmarks
Sources/DistributedActorsBenchmarks
ActorPingPongBenchmarks.swift
ActorRemotePingPongBenchmarks.swift
101:129 (11%)
90:117 (12%)
view
19 x 2 Sources/DistributedActorsBenchmarks
Sources/DistributedActorsBenchmarks
ActorPingPongBenchmarks.swift
ActorRemotePingPongBenchmarks.swift
132:160 (11%)
120:148 (12%)
view
18 x 2 Sources/DistributedActors
Sources/DistributedActors
ActorSystem.swift
ActorSystem.swift
552:571 (3%)
583:602 (3%)
view
17 x 2 Protos/Cluster
Protos/Cluster
proto
Cluster.proto
ClusterEvents.proto
1:21 (48%)
1:21 (47%)
view
17 x 2 Protos
Protos
proto
SystemMessages.proto
WireProtocol.proto
1:21 (34%)
1:21 (20%)
view
17 x 2 Protos/Cluster
Protos/Cluster
proto
ClusterEvents.proto
Membership.proto
1:21 (47%)
1:21 (29%)
view
17 x 2 Protos/Cluster
Protos/Cluster/SWIM
proto
ClusterEvents.proto
SWIM.proto
1:21 (47%)
1:21 (23%)
view
17 x 2 Protos/Cluster
Protos/Cluster
proto
Cluster.proto
Membership.proto
1:21 (48%)
1:21 (29%)
view
17 x 2 Protos/Cluster
Protos/Cluster/SWIM
proto
Membership.proto
SWIM.proto
1:21 (29%)
1:21 (23%)
view
17 x 2 Protos/Cluster
Protos/Cluster/SWIM
proto
Cluster.proto
SWIM.proto
1:21 (48%)
1:21 (23%)
view
Duplicated Units
The list of top 10 duplicated units.
See data for all 10 unit duplicates...
Size#FoldersFilesLinesCode
13 x 2 Sources/DistributedActors
Sources/DistributedActors
Adapters.swift
Adapters.swift
131:146 
347:362 
view
13 x 2 Sources/DistributedActors/Protobuf
Sources/DistributedActors/Protobuf
WireProtocol.pb.swift
WireProtocol.pb.swift
388:401 
546:559 
view
12 x 2 Sources/DistributedActors/Protobuf
Sources/DistributedActors/Protobuf
WireProtocol.pb.swift
WireProtocol.pb.swift
374:386 
532:544 
view
11 x 2 Sources/DistributedActors/Concurrency
Sources/DistributedActorsBenchmarks/Concurrency
locks.swift
_BlockingReceptacle.swift
139:150 
32:43 
view
11 x 2 Sources/DistributedActors/Concurrency
Sources/DistributedActorsBenchmarks/Concurrency
locks.swift
_BlockingReceptacle.swift
153:164 
46:57 
view
9 x 2 Sources/DistributedActors/Concurrency
Sources/DistributedActorsBenchmarks/Concurrency
locks.swift
_BlockingReceptacle.swift
166:175 
59:68 
view
7 x 2 Sources/DistributedActors/Concurrency
Sources/DistributedActorsBenchmarks/Concurrency
CountDownLatch.swift
CountDownLatch.swift
29:37 
30:38 
view
7 x 2 Sources/DistributedActors/Serialization
Sources/DistributedActors/Serialization
TopLevelBytesBlobCoders.swift
TopLevelProtobufCoders.swift
39:46 
38:45 
view
7 x 2 Sources/DistributedActors/Serialization
Sources/DistributedActors/Serialization
TopLevelBytesBlobCoders.swift
TopLevelProtobufCoders.swift
64:72 
63:71 
view
6 x 2 Sources/DistributedActors/Serialization
Sources/DistributedActors/Serialization
ActorRef+Serialization.swift
ActorRef+Serialization.swift
248:254 
258:264 
view