aws-samples / aws-greengrass-lambda-functions
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
  • 19% duplication:
    • 3,972 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 777 duplicated lines
  • 185 duplicates
system19% (777 lines)
Duplication per Extension
java16% (488 lines)
py37% (225 lines)
yaml40% (52 lines)
js9% (12 lines)
Duplication per Component (primary)
functions/CDDSenseHatJava14% (129 lines)
functions/CDDLatencyDashboard29% (68 lines)
functions/CDDEmbeddedVaadinSkeletonJava34% (58 lines)
functions/HelloWorldPythonWithCloudFormation64% (47 lines)
functions/BasicIngestPythonWithCloudFormation64% (47 lines)
functions/CDDSkeletonJava50% (45 lines)
functions/SharedFile1Python395% (44 lines)
functions/SharedFile2Python395% (44 lines)
functions/CDDDMIJava39% (43 lines)
functions/CDDDockerJava8% (42 lines)
functions/CDDKVSJava29% (37 lines)
functions/CDDMdnsServiceResolverJava15% (24 lines)
foundation/CDDBaselineJava3% (23 lines)
functions/CDDBenchmarkJava21% (19 lines)
functions/HelloWorldPython358% (18 lines)
functions/SecretsManagerPython327% (13 lines)
functions/RaspberryPiGpioPython324% (12 lines)
functions/CloudWatchMetricHandlerPython320% (9 lines)
functions/LatencyTesterPython316% (8 lines)
functions/HTTPPython14% (8 lines)
functions/SocketServerPython21% (7 lines)
functions/LiFXPython9% (7 lines)
functions/BenchmarkPython14% (7 lines)
functions/WebServerNode20% (6 lines)
functions/HTTPNode7% (6 lines)
functions/MqttClientPython312% (6 lines)
presentations/cloud-device-driver-framework-for-java0% (0 lines)
functions/HelloWorldNode0% (0 lines)
support-files0% (0 lines)
ROOT0% (0 lines)

Duplication Between Components (50+ lines)

G functions/CDDEmbeddedVaadinSkeletonJava functions/CDDEmbeddedVaadinSkeletonJava functions/CDDLatencyDashboard functions/CDDLatencyDashboard functions/CDDEmbeddedVaadinSkeletonJava--functions/CDDLatencyDashboard 98 functions/CDDSkeletonJava functions/CDDSkeletonJava functions/CDDEmbeddedVaadinSkeletonJava--functions/CDDSkeletonJava 62 functions/BasicIngestPythonWithCloudFormation functions/BasicIngestPythonWithCloudFormation functions/HelloWorldPythonWithCloudFormation functions/HelloWorldPythonWithCloudFormation functions/BasicIngestPythonWithCloudFormation--functions/HelloWorldPythonWithCloudFormation 94 functions/SharedFile1Python3 functions/SharedFile1Python3 functions/SharedFile2Python3 functions/SharedFile2Python3 functions/SharedFile1Python3--functions/SharedFile2Python3 88 functions/CDDDMIJava functions/CDDDMIJava functions/CDDDMIJava--functions/CDDEmbeddedVaadinSkeletonJava 56 functions/CDDDMIJava--functions/CDDLatencyDashboard 68 functions/CDDKVSJava functions/CDDKVSJava functions/CDDDMIJava--functions/CDDKVSJava 62 functions/CDDKVSJava--functions/CDDLatencyDashboard 56 functions/CDDKVSJava--functions/CDDSkeletonJava 52

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 185 duplicates...
Size#FoldersFilesLinesCode
44 x 2 functions/SharedFile1Python3
functions/SharedFile2Python3
SharedFile1Python3.py
SharedFile2Python3.py
13:83 (100%)
13:83 (100%)
view
21 x 2 functions/BasicIngestPythonWithCloudFormation
functions/HelloWorldPythonWithCloudFormation
BasicIngestPythonWithCloudFormation.py
HelloWorldPythonWithCloudFormation.py
22:56 (77%)
22:56 (77%)
view
20 x 2 functions/CDDEmbeddedVaa...ddedvaadinskeleton/data
functions/CDDLatencyDash...ddlatencydashboard/data
Topics.java
Topics.java
8:41 (100%)
10:41 (100%)
view
20 x 2 functions/CDDDMIJava/src.../greengrass/cdddmi/data
functions/CDDLatencyDash...ddlatencydashboard/data
Topics.java
Topics.java
8:39 (100%)
10:41 (100%)
view
20 x 2 functions/CDDKVSJava/src.../greengrass/cddkvs/data
functions/CDDSkeletonJav...ngrass/cddskeleton/data
Topics.java
Topics.java
8:40 (100%)
8:40 (100%)
view
20 x 2 functions/CDDDMIJava/src.../greengrass/cdddmi/data
functions/CDDEmbeddedVaa...ddedvaadinskeleton/data
Topics.java
Topics.java
8:39 (100%)
8:41 (100%)
view
16 x 2 functions/BasicIngestPythonWithCloudFormation
functions/HelloWorldPythonWithCloudFormation
function.cf.yaml
function.cf.yaml
33:48 (36%)
33:48 (36%)
view
15 x 2 functions/BasicIngestPythonWithCloudFormation
functions/HelloWorldPython3
BasicIngestPythonWithCloudFormation.py
HelloWorldPython3.py
27:52 (55%)
28:52 (51%)
view
15 x 2 functions/HelloWorldPython3
functions/HelloWorldPythonWithCloudFormation
HelloWorldPython3.py
HelloWorldPythonWithCloudFormation.py
28:52 (51%)
27:52 (55%)
view
14 x 2 functions/CDDKVSJava/src.../greengrass/cddkvs/data
functions/CDDLatencyDash...ddlatencydashboard/data
Topics.java
Topics.java
15:40 (70%)
16:41 (70%)
view
14 x 2 functions/CDDEmbeddedVaa...dembeddedvaadinskeleton
functions/CDDLatencyDash...ass/cddlatencydashboard
App.java
App.java
12:36 (100%)
12:36 (100%)
view
14 x 2 functions/CDDLatencyDash...ddlatencydashboard/data
functions/CDDSkeletonJav...ngrass/cddskeleton/data
Topics.java
Topics.java
16:41 (70%)
15:40 (70%)
view
14 x 2 functions/CDDDMIJava/src.../greengrass/cdddmi/data
functions/CDDKVSJava/src.../greengrass/cddkvs/data
Topics.java
Topics.java
14:39 (70%)
15:40 (70%)
view
14 x 2 functions/CDDEmbeddedVaa...ddedvaadinskeleton/data
functions/CDDKVSJava/src.../greengrass/cddkvs/data
Topics.java
Topics.java
16:41 (70%)
15:40 (70%)
view
14 x 2 functions/CDDEmbeddedVaa...ddedvaadinskeleton/data
functions/CDDSkeletonJav...ngrass/cddskeleton/data
Topics.java
Topics.java
16:41 (70%)
15:40 (70%)
view
14 x 2 functions/CDDDMIJava/src.../greengrass/cdddmi/data
functions/CDDSkeletonJav...ngrass/cddskeleton/data
Topics.java
Topics.java
14:39 (70%)
15:40 (70%)
view
13 x 2 functions/HelloWorldPython3
functions/SecretsManagerPython3
HelloWorldPython3.py
SecretsManagerPython3.py
28:49 (44%)
14:32 (36%)
view
13 x 2 functions/HelloWorldPythonWithCloudFormation
functions/SecretsManagerPython3
HelloWorldPythonWithCloudFormation.py
SecretsManagerPython3.py
27:48 (48%)
14:32 (36%)
view
13 x 2 functions/BasicIngestPythonWithCloudFormation
functions/SecretsManagerPython3
BasicIngestPythonWithCloudFormation.py
SecretsManagerPython3.py
27:48 (48%)
14:32 (36%)
view
13 x 2 functions/CDDDMIJava/src...onaws/greengrass/cdddmi
functions/CDDMdnsService.../cddmdnsserviceresolver
App.java
App.java
12:34 (92%)
12:34 (92%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
27 x 2 functions/SharedFile1Python3
functions/SharedFile2Python3
SharedFile1Python3.py
SharedFile2Python3.py
0:0 
0:0 
view
9 x 2 functions/CDDSenseHatJav...ensehat/leds/characters
functions/CDDSenseHatJav...ensehat/leds/characters
CharacterUpperV.java
CharacterLowerV.java
7:16 
7:16 
view
6 x 2 functions/CDDLatencyDash...atencydashboard/helpers
foundation/CDDBaselineJa...helpers/implementations
JsonHelper.java
BasicJsonHelper.java
9:15 
26:32 
view