aws-cloudformation / cloudformation-guard
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
  • 16% duplication:
    • 5,914 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 962 duplicated lines
  • 106 duplicates
system16% (962 lines)
Duplication per Extension
yaml63% (596 lines)
rs7% (366 lines)
Duplication per Component (primary)
guard/src7% (366 lines)
guard-examples/security-policies78% (233 lines)
guard-examples/encryption85% (136 lines)
guard-examples/deployment-safety54% (80 lines)
guard-examples/cross-account73% (62 lines)
guard-examples/infrastructure-related69% (43 lines)
guard-examples/network-reachability-analysis82% (42 lines)
guard/assets0% (0 lines)
guard0% (0 lines)
guard-lambda/src0% (0 lines)
guard-lambda0% (0 lines)
ROOT0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 106 duplicates...
Size#FoldersFilesLinesCode
21 x 2 guard-examples/network-reachability-analysis
guard-examples/network-reachability-analysis
redshift-clustersubnetgroup-tests.yaml
redshift-clustersubnetgroup-tests.yaml
2:22 (41%)
27:47 (41%)
view
18 x 2 guard-examples/encryption
guard-examples/encryption
dynamodb-table-sse-tests.yaml
dynamodb-table-sse-tests.yaml
24:41 (15%)
47:64 (15%)
view
17 x 2 guard/src/rules
guard/src/rules
parser.rs
parser.rs
1094:1110 (1%)
1123:1139 (1%)
view
17 x 2 guard-examples/encryption
guard-examples/encryption
dynamodb-table-sse-tests.yaml
dynamodb-table-sse-tests.yaml
42:58 (14%)
66:83 (14%)
view
17 x 2 guard/src/rules
guard/src/rules
evaluate.rs
evaluate.rs
970:990 (1%)
1061:1081 (1%)
view
16 x 2 guard-examples/security-policies
guard-examples/security-policies
apigateway-restapi-tests.yaml
apigateway-restapi-tests.yaml
104:119 (11%)
123:138 (11%)
view
16 x 2 guard/src/commands
guard/src/commands
helper.rs
validate.rs
12:30 (55%)
301:319 (3%)
view
16 x 2 guard-examples/security-policies
guard-examples/security-policies
apigateway-restapi-tests.yaml
apigateway-restapi-tests.yaml
34:49 (11%)
87:102 (11%)
view
16 x 2 guard-examples/infrastructure-related
guard-examples/infrastructure-related
check-tags-present-tests.yaml
check-tags-present-tests.yaml
9:24 (25%)
33:48 (25%)
view
15 x 2 guard-examples/security-policies
guard-examples/security-policies
elb-listener-tests.yaml
elb-listener-tests.yaml
23:37 (18%)
37:51 (18%)
view
15 x 2 guard-examples/security-policies
guard-examples/security-policies
apigateway-restapi-tests.yaml
apigateway-restapi-tests.yaml
68:82 (10%)
104:118 (10%)
view
15 x 2 guard-examples/security-policies
guard-examples/security-policies
apigateway-restapi-tests.yaml
apigateway-restapi-tests.yaml
68:82 (10%)
123:137 (10%)
view
14 x 2 guard-examples/security-policies
guard-examples/security-policies
apigateway-restapi-tests.yaml
apigateway-restapi-tests.yaml
14:27 (10%)
120:133 (10%)
view
14 x 2 guard-examples/cross-account
guard-examples/cross-account
sns-cross-account-tests.yaml
sns-cross-account-tests.yaml
45:58 (16%)
70:83 (16%)
view
13 x 2 guard-examples/encryption
guard-examples/encryption
dynamodb-table-sse-tests.yaml
dynamodb-table-sse-tests.yaml
55:67 (11%)
103:115 (11%)
view
13 x 2 guard-examples/security-policies
guard-examples/security-policies
elb-listener-tests.yaml
elb-listener-tests.yaml
11:23 (16%)
51:63 (16%)
view
12 x 2 guard/src/commands
guard/src/commands
tracker.rs
validate.rs
59:74 (14%)
500:515 (2%)
view
12 x 2 guard-examples/encryption
guard-examples/encryption
dynamodb-table-sse-tests.yaml
dynamodb-table-sse-tests.yaml
24:35 (10%)
72:83 (10%)
view
11 x 2 guard-examples/security-policies
guard-examples/security-policies
apigateway-restapi-tests.yaml
apigateway-restapi-tests.yaml
17:27 (7%)
68:78 (7%)
view
11 x 2 guard-examples/security-policies
guard-examples/security-policies
apigateway-restapi-tests.yaml
apigateway-restapi-tests.yaml
56:66 (7%)
123:133 (7%)
view