Code Duplication    Length = 9-9 lines in 4 locations

code/model/process/OrderStatusLog_SecurityCheck.php 4 locations

@@ 335-343 (lines=9) @@
332
        $otherBillingAddresses = BillingAddress::get()->filter(
333
            array('Phone' => $phoneArray) + $timeFilter
334
        )->exclude(array('OrderID' => $order->ID));
335
        foreach ($otherBillingAddresses as $address) {
336
            $otherOrder = $address->Order();
337
            if ($otherOrder && $otherOrder->ID != $order->ID) {
338
                if (!isset($similarArray[$otherOrder->ID])) {
339
                    $similarArray[$otherOrder->ID] = array();
340
                }
341
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
342
            }
343
        }
344
        $otherShippingAddresses = ShippingAddress::get()->filter(
345
            array('ShippingPhone' => $phoneArray) + $timeFilter
346
        )->exclude(array('OrderID' => $order->ID));
@@ 347-355 (lines=9) @@
344
        $otherShippingAddresses = ShippingAddress::get()->filter(
345
            array('ShippingPhone' => $phoneArray) + $timeFilter
346
        )->exclude(array('OrderID' => $order->ID));
347
        foreach ($otherShippingAddresses as $address) {
348
            $otherOrder = $address->Order();
349
            if ($otherOrder && $otherOrder->ID != $order->ID) {
350
                if (!isset($similarArray[$otherOrder->ID])) {
351
                    $similarArray[$otherOrder->ID] = array();
352
                }
353
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
354
            }
355
        }
356
        //adding all emails to security checks
357
        $this->blacklistCheck($phoneArray, 'EcommerceSecurityPhone');
358
@@ 375-383 (lines=9) @@
372
        $otherBillingAddresses = BillingAddress::get()->filter(
373
            array('Address' => $addressArray) + $timeFilter
374
        )->exclude(array('OrderID' => $order->ID));
375
        foreach ($otherBillingAddresses as $address) {
376
            $otherOrder = $address->Order();
377
            if ($otherOrder && $otherOrder->ID != $order->ID) {
378
                if (!isset($similarArray[$otherOrder->ID])) {
379
                    $similarArray[$otherOrder->ID] = array();
380
                }
381
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
382
            }
383
        }
384
        $otherShippingAddresses = ShippingAddress::get()
385
            ->filter(
386
                array('ShippingAddress' => $addressArray) + $timeFilter
@@ 389-397 (lines=9) @@
386
                array('ShippingAddress' => $addressArray) + $timeFilter
387
            )
388
            ->exclude(array('OrderID' => $order->ID));
389
        foreach ($otherShippingAddresses as $address) {
390
            $otherOrder = $address->Order();
391
            if ($otherOrder && $otherOrder->ID != $order->ID) {
392
                if (!isset($similarArray[$otherOrder->ID])) {
393
                    $similarArray[$otherOrder->ID] = array();
394
                }
395
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
396
            }
397
        }
398
        $this->blacklistCheck($addressArray, 'EcommerceSecurityAddress');
399
400