aws-samples / aws-iot-greengrass-edge-analytics-workshop
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
  • 17% duplication:
    • 903 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 160 duplicated lines
  • 7 duplicates
system17% (160 lines)
Duplication per Extension
py35% (84 lines)
ts11% (76 lines)
Duplication per Component (primary)
lib11% (76 lines)
lib/custom-certificate-handler46% (42 lines)
lib/greengrass-service-role-handler71% (42 lines)
lib/receiver-lambda0% (0 lines)
lib/analyzer-lambda0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G lib/custom-certificate-handler lib/custom-certificate-handler lib/greengrass-service-role-handler lib/greengrass-service-role-handler lib/custom-certificate-handler--lib/greengrass-service-role-handler 84

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 7 longest duplicates.
See data for all 7 duplicates...
Size#FoldersFilesLinesCode
28 x 2 lib/custom-certificate-handler
lib/greengrass-service-role-handler
cfnresponse.py
cfnresponse.py
25:60 (100%)
25:60 (100%)
view
21 x 2 lib
lib
custom-certificate-resource.ts
custom-greengrass-service-role-resour...
48:72 (20%)
44:68 (31%)
view
11 x 2 lib
lib
custom-certificate-resource.ts
custom-greengrass-service-role-resour...
84:96 (10%)
62:74 (16%)
view
9 x 2 lib
lib
custom-certificate-resource.ts
custom-greengrass-service-role-resour...
100:108 (8%)
76:84 (13%)
view
8 x 2 lib/custom-certificate-handler
lib/greengrass-service-role-handler
custom-certificate-lambda.py
greengrass-service-role-lambda.py
83:91 (12%)
51:59 (25%)
view
6 x 2 lib/custom-certificate-handler
lib/greengrass-service-role-handler
custom-certificate-lambda.py
greengrass-service-role-lambda.py
24:31 (9%)
24:31 (19%)
view
6 x 2 lib
lib
custom-certificate-resource.ts
custom-certificate-resource.ts
66:72 (5%)
84:90 (5%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
25 x 2 lib/custom-certificate-handler
lib/greengrass-service-role-handler
cfnresponse.py
cfnresponse.py
0:0 
0:0 
view