Code Duplication    Length = 9-9 lines in 4 locations

code/model/process/OrderStatusLog_SecurityCheck.php 4 locations

@@ 397-405 (lines=9) @@
394
        $otherBillingAddresses = BillingAddress::get()->filter(
395
            array('Phone' => $phoneArray) + $timeFilter
396
        )->exclude(array('OrderID' => $order->ID));
397
        foreach ($otherBillingAddresses as $address) {
398
            $otherOrder = $address->Order();
399
            if ($otherOrder && $otherOrder->ID != $order->ID) {
400
                if (!isset($similarArray[$otherOrder->ID])) {
401
                    $similarArray[$otherOrder->ID] = array();
402
                }
403
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
404
            }
405
        }
406
        $otherShippingAddresses = ShippingAddress::get()->filter(
407
            array('ShippingPhone' => $phoneArray) + $timeFilter
408
        )->exclude(array('OrderID' => $order->ID));
@@ 409-417 (lines=9) @@
406
        $otherShippingAddresses = ShippingAddress::get()->filter(
407
            array('ShippingPhone' => $phoneArray) + $timeFilter
408
        )->exclude(array('OrderID' => $order->ID));
409
        foreach ($otherShippingAddresses as $address) {
410
            $otherOrder = $address->Order();
411
            if ($otherOrder && $otherOrder->ID != $order->ID) {
412
                if (!isset($similarArray[$otherOrder->ID])) {
413
                    $similarArray[$otherOrder->ID] = array();
414
                }
415
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
416
            }
417
        }
418
        //adding all emails to security checks
419
        $this->blacklistCheck($phoneArray, 'EcommerceSecurityPhone');
420
@@ 437-445 (lines=9) @@
434
        $otherBillingAddresses = BillingAddress::get()->filter(
435
            array('Address' => $addressArray) + $timeFilter
436
        )->exclude(array('OrderID' => $order->ID));
437
        foreach ($otherBillingAddresses as $address) {
438
            $otherOrder = $address->Order();
439
            if ($otherOrder && $otherOrder->ID != $order->ID) {
440
                if (!isset($similarArray[$otherOrder->ID])) {
441
                    $similarArray[$otherOrder->ID] = array();
442
                }
443
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
444
            }
445
        }
446
        $otherShippingAddresses = ShippingAddress::get()
447
            ->filter(
448
                array('ShippingAddress' => $addressArray) + $timeFilter
@@ 451-459 (lines=9) @@
448
                array('ShippingAddress' => $addressArray) + $timeFilter
449
            )
450
            ->exclude(array('OrderID' => $order->ID));
451
        foreach ($otherShippingAddresses as $address) {
452
            $otherOrder = $address->Order();
453
            if ($otherOrder && $otherOrder->ID != $order->ID) {
454
                if (!isset($similarArray[$otherOrder->ID])) {
455
                    $similarArray[$otherOrder->ID] = array();
456
                }
457
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
458
            }
459
        }
460
        $this->blacklistCheck($addressArray, 'EcommerceSecurityAddress');
461
462