aws-samples / aws-cdk-project-template-for-devops
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
  • 15% duplication:
    • 1,030 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 158 duplicated lines
  • 30 duplicates
system15% (158 lines)
Duplication per Extension
ts21% (158 lines)
Duplication per Component (primary)
lib/template/pattern26% (73 lines)
lib/template/construct61% (29 lines)
lib/template/stack26% (29 lines)
infra/stack26% (27 lines)
codes/sample-backend-fastapi/app0% (0 lines)
lib/template0% (0 lines)
lib/template/common0% (0 lines)
infra0% (0 lines)
infra/stack/template0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G lib/template/construct lib/template/construct lib/template/stack lib/template/stack lib/template/construct--lib/template/stack 50

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 30 duplicates...
Size#FoldersFilesLinesCode
19 x 2 lib/template/construct/base
lib/template/stack/base
base-construct.ts
base-stack.ts
61:96 (40%)
64:98 (40%)
view
9 x 2 infra/stack
infra/stack
sample-vpc-cloud9-stack.ts
sample-vpc-ecs-stack.ts
12:24 (50%)
14:26 (20%)
view
9 x 2 infra/stack
infra/stack
sample-vpc-cloud9-stack.ts
sample-vpc-rds-stack.ts
12:24 (50%)
13:25 (33%)
view
9 x 2 infra/stack
infra/stack
sample-vpc-ecs-stack.ts
sample-vpc-rds-stack.ts
14:26 (20%)
13:25 (33%)
view
8 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
216:223 (3%)
232:239 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
197:203 (3%)
263:269 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
124:130 (3%)
197:203 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
124:130 (3%)
146:152 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
124:130 (3%)
248:254 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
146:152 (3%)
197:203 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
146:152 (3%)
248:254 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
102:108 (3%)
276:282 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
146:152 (3%)
263:269 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
248:254 (3%)
263:269 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
197:203 (3%)
248:254 (3%)
view
7 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
124:130 (3%)
263:269 (3%)
view
6 x 2 lib/template/construct/base
lib/template/stack/base
base-construct.ts
base-stack.ts
53:59 (12%)
56:62 (12%)
view
6 x 2 lib/template/stack/base
lib/template/stack/base
base-stack.ts
base-stack.ts
53:58 (12%)
61:66 (12%)
view
6 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
103:108 (2%)
264:269 (2%)
view
6 x 2 lib/template/pattern
lib/template/pattern
cloudwatch-pattern.ts
cloudwatch-pattern.ts
125:130 (2%)
277:282 (2%)
view