awslabs / swage
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:
    • 1,948 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 157 duplicated lines
  • 11 duplicates
system8% (157 lines)
Duplication per Extension
java8% (157 lines)
Duplication per Component (primary)
type-safe/src/benchmarks/java/software/amazon/swage/collection29% (66 lines)
metrics-core/src/main/java/software/amazon/swage/metrics/record6% (30 lines)
type-safe/src/main/java/software/amazon/swage/collection15% (25 lines)
thread-context/src/main/java/software/amazon/swage/threadcontext12% (18 lines)
disseminating-executors/src/main/java/software/amazon/swage/concurrent9% (18 lines)
metrics-core/src/main/java/software/amazon/swage/metrics0% (0 lines)
metrics-core/src/main/java/software/amazon/swage/metrics/jmx0% (0 lines)
metrics-core/src/main/java/software/amazon/swage/metrics/measures0% (0 lines)
metrics-core/src/benchmarks/java/com/amazon/metrics0% (0 lines)
metrics-api/src/main/java/software/amazon/swage/metrics0% (0 lines)
metrics-api/src/main/java/software/amazon/swage/metrics/record0% (0 lines)

Duplication Between Components (50+ lines)

G type-safe/src/benchmarks/java/software/amazon/swage/collection type-safe/src/benchmarks/java/software/amazon/swage/collection type-safe/src/main/java/software/amazon/swage/collection type-safe/src/main/java/software/amazon/swage/collection type-safe/src/benchmarks/java/software/amazon/swage/collection--type-safe/src/main/java/software/amazon/swage/collection 57

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 11 longest duplicates.
See data for all 11 duplicates...
Size#FoldersFilesLinesCode
18 x 2 disseminating-executors/...amazon/swage/concurrent
thread-context/src/main/...zon/swage/threadcontext
StateCapture.java
ContextAwareExecutorService.java
312:341 (10%)
40:69 (39%)
view
11 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/benchmarks...amazon/swage/collection
TypedMapBenchmarks.java
TypedMapBenchmarks.java
90:107 (12%)
115:131 (12%)
view
10 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/benchmarks...amazon/swage/collection
TypedMapBenchmarks.java
TypedMapBenchmarks.java
90:104 (11%)
138:151 (11%)
view
10 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/benchmarks...amazon/swage/collection
TypedMapBenchmarks.java
TypedMapBenchmarks.java
115:128 (11%)
138:151 (11%)
view
9 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/main/java/...amazon/swage/collection
GuavaTypedMap.java
ImmutableTypedMap.java
70:82 (15%)
106:118 (14%)
view
9 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/main/java/...amazon/swage/collection
GuavaTypedMap.java
ImmutableTypedMap.java
53:64 (15%)
89:100 (14%)
view
8 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/benchmarks...amazon/swage/collection
GuavaTypedMap.java
ListTypedMap.java
85:95 (13%)
151:161 (10%)
view
8 x 2 metrics-core/src/main/ja...trics/record/cloudwatch
metrics-core/src/main/ja...age/metrics/record/file
CloudWatchRecorder.java
FileRecorder.java
380:389 (3%)
125:134 (8%)
view
7 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/main/java/...amazon/swage/collection
ListTypedMap.java
ImmutableTypedMap.java
151:158 (8%)
76:83 (11%)
view
7 x 2 metrics-core/src/main/ja...trics/record/cloudwatch
metrics-core/src/main/ja...age/metrics/record/file
CloudWatchRecorder.java
FileRecorder.java
391:401 (3%)
136:146 (7%)
view
7 x 2 type-safe/src/benchmarks...amazon/swage/collection
type-safe/src/main/java/...amazon/swage/collection
GuavaTypedMap.java
ImmutableTypedMap.java
85:92 (11%)
76:83 (11%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
7 x 2 type-safe/src/main/java/...amazon/swage/collection
type-safe/src/benchmarks...amazon/swage/collection
ImmutableTypedMap.java
GuavaTypedMap.java
112:119 
76:83 
view