Code Duplication    Length = 6-7 lines in 9 locations

src/plugins/onTick/notifications.php 9 locations

@@ 190-196 (lines=7) @@
187
                    $notificationString = explode("\n", $this->getNotificationText($keyID, $vCode, $characterID,
188
                        $notificationID));
189
                    switch ($typeID) {
190
                        case 5: // War Declared
191
                            $defAllianceID = trim(explode(": ", $notificationString[0])[1]);
192
                            $aggAllianceID = trim(explode(": ", $notificationString[2])[1]);
193
                            $defAllianceName = apiCharacterName($defAllianceID);
194
                            $aggAllianceName = apiCharacterName($aggAllianceID);
195
                            $msg = "@everyone | War declared by {$aggAllianceName} against {$defAllianceName}. Fighting begins in roughly 24 hours.";
196
                            break;
197
                        case 6: // Corp joins war (Not enough info in api to say who the 3rd party is)
198
                            $defAllianceID = trim(explode(": ", $notificationString[0])[1]);
199
                            $aggAllianceID = trim(explode(": ", $notificationString[2])[1]);
@@ 204-210 (lines=7) @@
201
                            $aggAllianceName = apiCharacterName($aggAllianceID);
202
                            $msg = "The war between {$aggAllianceName} and {$defAllianceName} has been joined by a third party. This new group may begin fighting in roughly 24 hours.";
203
                            break;
204
                        case 7: // War Declared corp
205
                            $defCorpID = trim(explode(": ", $notificationString[0])[1]);
206
                            $aggCorpID = trim(explode(": ", $notificationString[2])[1]);
207
                            $defCorpName = apiCharacterName($defCorpID);
208
                            $aggCorpName = apiCharacterName($aggCorpID);
209
                            $msg = "@everyone | War declared by {$aggCorpName} against {$defCorpName}. Fighting begins in roughly 24 hours.";
210
                            break;
211
                        case 8: // Alliance war invalidated by CONCORD
212
                            $aggAllianceID = trim(explode(": ", $notificationString[2])[1]);
213
                            $aggAllianceName = apiCharacterName($aggAllianceID);
@@ 252-258 (lines=7) @@
249
                        case 35: // Insurance payment
250
                            $msg = "skip";
251
                            break;
252
                        case 41: // System lost
253
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
254
                            $systemName = apiCharacterName($solarSystemID);
255
                            $allianceID = trim(explode(": ", $notificationString[0])[1]);
256
                            $allianceName = apiCharacterName($allianceID);
257
                            $msg = "{$allianceName} has lost control of **{$systemName}**";
258
                            break;
259
                        case 43: // System captured
260
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
261
                            $systemName = apiCharacterName($solarSystemID);
@@ 259-265 (lines=7) @@
256
                            $allianceName = apiCharacterName($allianceID);
257
                            $msg = "{$allianceName} has lost control of **{$systemName}**";
258
                            break;
259
                        case 43: // System captured
260
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
261
                            $systemName = apiCharacterName($solarSystemID);
262
                            $allianceID = trim(explode(": ", $notificationString[0])[1]);
263
                            $allianceName = apiCharacterName($allianceID);
264
                            $msg = "{$allianceName} now controls **{$systemName}**";
265
                            break;
266
                        case 52: // clone revoked
267
                            $msg = "skip";
268
                            break;
@@ 376-382 (lines=7) @@
373
                        case 141: // Kill report
374
                            $msg = "skip";
375
                            break;
376
                        case 147: // Entosis has started
377
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
378
                            $systemName = apiCharacterName($solarSystemID);
379
                            $typeID = trim(explode(": ", $notificationString[1])[1]);
380
                            $typeName = apiTypeName($typeID);
381
                            $msg = "Entosis has started in **{$systemName}** on **{$typeName}** (Date: **{$sentDate}**)";
382
                            break;
383
                        case 148: // Entosis enabled a module ??????
384
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
385
                            $systemName = apiCharacterName($solarSystemID);
@@ 383-389 (lines=7) @@
380
                            $typeName = apiTypeName($typeID);
381
                            $msg = "Entosis has started in **{$systemName}** on **{$typeName}** (Date: **{$sentDate}**)";
382
                            break;
383
                        case 148: // Entosis enabled a module ??????
384
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
385
                            $systemName = apiCharacterName($solarSystemID);
386
                            $typeID = trim(explode(": ", $notificationString[1])[1]);
387
                            $typeName = apiTypeName($typeID);
388
                            $msg = "Entosis has enabled a module in **{$systemName}** on **{$typeName}** (Date: **{$sentDate}**)";
389
                            break;
390
                        case 149: // Entosis disabled a module
391
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
392
                            $systemName = apiCharacterName($solarSystemID);
@@ 390-396 (lines=7) @@
387
                            $typeName = apiTypeName($typeID);
388
                            $msg = "Entosis has enabled a module in **{$systemName}** on **{$typeName}** (Date: **{$sentDate}**)";
389
                            break;
390
                        case 149: // Entosis disabled a module
391
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
392
                            $systemName = apiCharacterName($solarSystemID);
393
                            $typeID = trim(explode(": ", $notificationString[1])[1]);
394
                            $typeName = apiTypeName($typeID);
395
                            $msg = "Entosis has disabled a module in **{$systemName}** on **{$typeName}** (Date: **{$sentDate}**)";
396
                            break;
397
                        case 160: // Entosis successful
398
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
399
                            $systemName = apiCharacterName($solarSystemID);
@@ 417-422 (lines=6) @@
414
                            $systemName = apiCharacterName($solarSystemID);
415
                            $msg = "Station in **{$systemName}** has now entered freeport mode.";
416
                            break;
417
                        case 182: //  Citadel being anchored
418
                            $corpName = trim(explode(": ", $notificationString[1])[1]);
419
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
420
                            $systemName = apiCharacterName($solarSystemID);
421
                            $msg = "Citadel owned by **{$corpName}** is being anchored in **{$systemName}**.";
422
                            break;
423
                        case 184: //  Citadel under attack
424
                            $aggID = trim(explode(": ", $notificationString[7])[1]);
425
                            $aggCharacterName = apiCharacterName($aggID);
@@ 439-445 (lines=7) @@
436
                            $systemName = apiCharacterName($solarSystemID);
437
                            $msg = "Citadel now online in **{$systemName}**.";
438
                            break;
439
                        case 188: //  Citadel destroyed
440
                            $corpID = trim(explode("- ", $notificationString[3])[1]);
441
                            $corpName = apiCharacterName($corpID);
442
                            $solarSystemID = trim(explode(": ", $notificationString[5])[1]);
443
                            $systemName = apiCharacterName($solarSystemID);
444
                            $msg = "Citadel owned by **{$corpName}** in **{$systemName}** has been destroyed.";
445
                            break;
446
                        case 199: // citadel delivery
447
                            $msg = "skip";
448
                            break;