Code Duplication    Length = 9-9 lines in 4 locations

code/model/process/OrderStatusLog_SecurityCheck.php 4 locations

@@ 325-333 (lines=9) @@
322
        $otherBillingAddresses = BillingAddress::get()->filter(
323
            array('Phone' => $phoneArray) + $timeFilter
324
        )->exclude(array('OrderID' => $order->ID));
325
        foreach ($otherBillingAddresses as $address) {
326
            $otherOrder = $address->Order();
327
            if ($otherOrder && $otherOrder->ID != $order->ID) {
328
                if (!isset($similarArray[$otherOrder->ID])) {
329
                    $similarArray[$otherOrder->ID] = array();
330
                }
331
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
332
            }
333
        }
334
        $otherShippingAddresses = ShippingAddress::get()->filter(
335
            array('ShippingPhone' => $phoneArray) + $timeFilter
336
        )->exclude(array('OrderID' => $order->ID));
@@ 337-345 (lines=9) @@
334
        $otherShippingAddresses = ShippingAddress::get()->filter(
335
            array('ShippingPhone' => $phoneArray) + $timeFilter
336
        )->exclude(array('OrderID' => $order->ID));
337
        foreach ($otherShippingAddresses as $address) {
338
            $otherOrder = $address->Order();
339
            if ($otherOrder && $otherOrder->ID != $order->ID) {
340
                if (!isset($similarArray[$otherOrder->ID])) {
341
                    $similarArray[$otherOrder->ID] = array();
342
                }
343
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
344
            }
345
        }
346
        //adding all emails to security checks
347
        $this->blacklistCheck($phoneArray, 'EcommerceSecurityPhone');
348
@@ 365-373 (lines=9) @@
362
        $otherBillingAddresses = BillingAddress::get()->filter(
363
            array('Address' => $addressArray) + $timeFilter
364
        )->exclude(array('OrderID' => $order->ID));
365
        foreach ($otherBillingAddresses as $address) {
366
            $otherOrder = $address->Order();
367
            if ($otherOrder && $otherOrder->ID != $order->ID) {
368
                if (!isset($similarArray[$otherOrder->ID])) {
369
                    $similarArray[$otherOrder->ID] = array();
370
                }
371
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
372
            }
373
        }
374
        $otherShippingAddresses = ShippingAddress::get()
375
            ->filter(
376
                array('ShippingAddress' => $addressArray) + $timeFilter
@@ 379-387 (lines=9) @@
376
                array('ShippingAddress' => $addressArray) + $timeFilter
377
            )
378
            ->exclude(array('OrderID' => $order->ID));
379
        foreach ($otherShippingAddresses as $address) {
380
            $otherOrder = $address->Order();
381
            if ($otherOrder && $otherOrder->ID != $order->ID) {
382
                if (!isset($similarArray[$otherOrder->ID])) {
383
                    $similarArray[$otherOrder->ID] = array();
384
                }
385
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
386
            }
387
        }
388
        $this->blacklistCheck($addressArray, 'EcommerceSecurityAddress');
389
390