awslabs / aws-embedded-metrics-java
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
  • 4% duplication:
    • 1,493 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 62 duplicated lines
  • 3 duplicates
system4% (62 lines)
Duplication per Extension
yml65% (34 lines)
java1% (28 lines)
Duplication per Component (primary)
buildspecs65% (34 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/model4% (16 lines)
src/integration-test/java/software/amazon/cloudwatchlogs/emf11% (12 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/environment0% (0 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/exception0% (0 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/config0% (0 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/logger0% (0 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/util0% (0 lines)
src/main/java/software/amazon/cloudwatchlogs/emf0% (0 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/serializers0% (0 lines)
src/main/java/software/amazon/cloudwatchlogs/emf/sinks0% (0 lines)
canarytests/agent/src/main/java/emf/canary0% (0 lines)
Longest Duplicates
The list of 3 longest duplicates.
See data for all 3 duplicates...
Size#FoldersFilesLinesCode
17 x 2 buildspecs
buildspecs
buildspec.canary.yml
buildspec.yml
1:20 (94%)
1:20 (94%)
view
8 x 2 src/main/java/software/a...loudwatchlogs/emf/model
src/main/java/software/a...loudwatchlogs/emf/model
DimensionSet.java
DimensionSet.java
85:92 (13%)
113:120 (13%)
view
6 x 2 src/integration-test/jav...azon/cloudwatchlogs/emf
src/integration-test/jav...azon/cloudwatchlogs/emf
MetricsLoggerIntegrationTest.java
MetricsLoggerIntegrationTest.java
78:84 (6%)
107:113 (6%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
11 x 2 src/integration-test/jav...azon/cloudwatchlogs/emf
src/integration-test/jav...azon/cloudwatchlogs/emf
MetricsLoggerIntegrationTest.java
MetricsLoggerIntegrationTest.java
72:85 
101:114 
view
8 x 2 src/integration-test/jav...azon/cloudwatchlogs/emf
src/integration-test/jav...azon/cloudwatchlogs/emf
MetricsLoggerIntegrationTest.java
MetricsLoggerIntegrationTest.java
59:69 
88:98 
view