awslabs / aws-embedded-metrics-node
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:
    • 862 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 88 duplicated lines
  • 8 duplicates
system10% (88 lines)
Duplication per Extension
yml75% (60 lines)
ts3% (28 lines)
Duplication per Component (primary)
buildspecs75% (60 lines)
src/environment10% (28 lines)
src0% (0 lines)
src/config0% (0 lines)
src/logger0% (0 lines)
src/utils0% (0 lines)
src/serializers0% (0 lines)
src/sinks0% (0 lines)
src/sinks/connections0% (0 lines)
Longest Duplicates
The list of 8 longest duplicates.
See data for all 8 duplicates...
Size#FoldersFilesLinesCode
17 x 2 buildspecs
buildspecs
buildspec.canary.yml
buildspec.yml
1:20 (89%)
1:20 (77%)
view
11 x 2 buildspecs
buildspecs
buildspec-node14.yml
buildspec.yml
13:26 (50%)
13:26 (50%)
view
11 x 2 src/environment
src/environment
DefaultEnvironment.ts
LocalEnvironment.ts
29:45 (47%)
32:48 (52%)
view
10 x 2 buildspecs
buildspecs
buildspec-node14.yml
buildspec.canary.yml
1:11 (45%)
1:11 (52%)
view
10 x 2 buildspecs
buildspecs
buildspec-node14.yml
buildspec.yml
1:11 (45%)
1:11 (45%)
view
6 x 2 src/environment
src/environment
DefaultEnvironment.ts
EC2Environment.ts
29:37 (26%)
51:59 (14%)
view
6 x 2 src/environment
src/environment
EC2Environment.ts
LocalEnvironment.ts
51:59 (14%)
32:40 (28%)
view
6 x 2 buildspecs
buildspecs
buildspec-node14.yml
buildspec.canary.yml
13:20 (27%)
13:20 (31%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
6 x 3 src/environment
src/environment
src/environment
LocalEnvironment.ts
DefaultEnvironment.ts
EC2Environment.ts
32:38 
29:35 
51:57 
view
6 x 2 src/environment
src/environment
LocalEnvironment.ts
DefaultEnvironment.ts
40:46 
37:43 
view