opensearch-project / alerting
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:
    • 9,888 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,573 duplicated lines
  • 268 duplicates
system15% (1,573 lines)
Duplication per Extension
kt16% (1,528 lines)
java7% (45 lines)
Duplication per Component (primary)
alerting/src/main/kotlin/org/opensearch/alerting/transport42% (751 lines)
alerting/src/main/kotlin/org/opensearch/alerting/action33% (359 lines)
alerting/src/main/kotlin/org/opensearch/alerting/resthandler25% (192 lines)
alerting/src/main/kotlin/org/opensearch/alerting/model6% (138 lines)
alerting/src/main/kotlin/org/opensearch/alerting9% (88 lines)
notification/src/main/java/org/opensearch/alerting/destination7% (45 lines)
alerting/src/main/kotlin/org/opensearch/alerting/aggregation0% (0 lines)
alerting/src/main/kotlin/org/opensearch/alerting/settings0% (0 lines)
alerting/src/main/kotlin/org/opensearch/alerting/util0% (0 lines)
alerting/src/main/kotlin/org/opensearch/alerting/script0% (0 lines)
alerting/src/main/kotlin/org/opensearch/alerting/alerts0% (0 lines)
alerting/src/main/plugin-metadata0% (0 lines)
core/src/main/kotlin/org/opensearch/alerting/core0% (0 lines)
core/src/main/kotlin/org/opensearch/alerting/elasticapi0% (0 lines)
worksheets0% (0 lines)
release-notes0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 268 duplicates...
Size#FoldersFilesLinesCode
24 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportSearchEmailAccountAction.kt
TransportSearchEmailGroupAction.kt
34:68 (72%)
34:68 (72%)
view
23 x 2 alerting/src/main/kotlin...ensearch/alerting/model
alerting/src/main/kotlin...ensearch/alerting/model
Alert.kt
Alert.kt
56:79 (8%)
74:97 (8%)
view
22 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexMonitorAction.kt
TransportIndexMonitorAction.kt
377:402 (7%)
448:474 (7%)
view
20 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexEmailAccountAction.kt
TransportIndexEmailGroupAction.kt
82:109 (10%)
74:101 (13%)
view
20 x 2 alerting/src/main/kotlin/org/opensearch/alerting
alerting/src/main/kotlin/org/opensearch/alerting
MonitorRunner.kt
MonitorRunner.kt
645:669 (5%)
677:701 (5%)
view
18 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportDeleteDestinationAction.kt
TransportIndexDestinationAction.kt
107:130 (21%)
236:259 (8%)
view
16 x 2 alerting/src/main/kotlin...nsearch/alerting/action
alerting/src/main/kotlin...nsearch/alerting/action
GetEmailAccountRequest.kt
GetEmailGroupRequest.kt
29:49 (43%)
29:49 (43%)
view
16 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexDestinationAction.kt
TransportIndexDestinationAction.kt
158:175 (7%)
276:293 (7%)
view
16 x 2 alerting/src/main/kotlin...nsearch/alerting/action
alerting/src/main/kotlin...nsearch/alerting/action
GetEmailGroupRequest.kt
GetMonitorRequest.kt
29:49 (43%)
29:49 (47%)
view
16 x 2 alerting/src/main/kotlin...nsearch/alerting/action
alerting/src/main/kotlin...nsearch/alerting/action
GetEmailAccountRequest.kt
GetMonitorRequest.kt
29:49 (43%)
29:49 (47%)
view
15 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexEmailAccountAction.kt
TransportIndexEmailGroupAction.kt
194:211 (7%)
131:148 (10%)
view
14 x 2 alerting/src/main/kotlin...nsearch/alerting/action
alerting/src/main/kotlin...nsearch/alerting/action
GetEmailGroupResponse.kt
IndexEmailGroupResponse.kt
37:52 (25%)
37:52 (29%)
view
14 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexDestinationAction.kt
TransportIndexMonitorAction.kt
158:173 (6%)
448:463 (4%)
view
14 x 2 alerting/src/main/kotlin...nsearch/alerting/action
alerting/src/main/kotlin...nsearch/alerting/action
GetMonitorResponse.kt
IndexMonitorResponse.kt
37:52 (25%)
37:52 (29%)
view
14 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexDestinationAction.kt
TransportIndexMonitorAction.kt
158:173 (6%)
377:391 (4%)
view
14 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexDestinationAction.kt
TransportIndexMonitorAction.kt
276:291 (6%)
377:391 (4%)
view
14 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexDestinationAction.kt
TransportIndexMonitorAction.kt
276:291 (6%)
448:463 (4%)
view
14 x 2 alerting/src/main/kotlin...nsearch/alerting/action
alerting/src/main/kotlin...nsearch/alerting/action
GetEmailAccountResponse.kt
IndexEmailAccountResponse.kt
37:52 (25%)
37:52 (29%)
view
12 x 2 notification/src/main/ja...ing/destination/message
notification/src/main/ja...ing/destination/message
ChimeMessage.java
SlackMessage.java
26:43 (33%)
30:47 (28%)
view
12 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexDestinationAction.kt
TransportIndexMonitorAction.kt
102:119 (5%)
228:245 (3%)
view
Duplicated Units
The list of top 10 duplicated units.
See data for all 10 unit duplicates...
Size#FoldersFilesLinesCode
25 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportSearchEmailGroupAction.kt
TransportSearchEmailAccountAction.kt
42:70 
42:70 
view
18 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportGetDestinationsAction.kt
TransportGetAlertsAction.kt
113:134 
112:134 
view
15 x 2 alerting/src/main/kotlin...ch/alerting/resthandler
alerting/src/main/kotlin...ch/alerting/resthandler
RestSearchEmailGroupAction.kt
RestSearchEmailAccountAction.kt
47:62 
47:62 
view
15 x 2 alerting/src/main/kotlin...ch/alerting/resthandler
alerting/src/main/kotlin...ch/alerting/resthandler
RestGetEmailAccountAction.kt
RestGetEmailGroupAction.kt
35:50 
35:50 
view
15 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportDeleteMonitorAction.kt
TransportIndexMonitorAction.kt
99:114 
410:425 
view
14 x 2 alerting/src/main/kotlin...arch/alerting/transport
alerting/src/main/kotlin...arch/alerting/transport
TransportIndexMonitorAction.kt
TransportIndexMonitorAction.kt
383:397 
455:469 
view
10 x 4 alerting/src/main/kotlin...ch/alerting/resthandler
alerting/src/main/kotlin...ch/alerting/resthandler
alerting/src/main/kotlin...ch/alerting/resthandler
alerting/src/main/kotlin...ch/alerting/resthandler
RestIndexDestinationAction.kt
RestIndexEmailAccountAction.kt
RestIndexMonitorAction.kt
RestIndexEmailGroupAction.kt
101:112 
96:108 
100:111 
96:108 
view
9 x 3 alerting/src/main/kotlin...ch/alerting/resthandler
alerting/src/main/kotlin...ch/alerting/resthandler
alerting/src/main/kotlin...ch/alerting/resthandler
RestDeleteEmailGroupAction.kt
RestDeleteEmailAccountAction.kt
RestDeleteDestinationAction.kt
38:47 
38:47 
39:48 
view
8 x 3 notification/src/main/ja...ing/destination/factory
notification/src/main/ja...ing/destination/factory
notification/src/main/ja...ing/destination/factory
ChimeDestinationFactory.java
CustomWebhookDestinationFactory.java
SlackDestinationFactory.java
30:38 
30:38 
30:38 
view
7 x 2 alerting/src/main/kotlin...rting/model/destination
alerting/src/main/kotlin...rting/model/destination
Slack.kt
Chime.kt
74:81 
74:81 
view