Code Duplication    Length = 9-9 lines in 4 locations

code/model/process/OrderStatusLog_SecurityCheck.php 4 locations

@@ 314-322 (lines=9) @@
311
        $otherBillingAddresses = BillingAddress::get()->filter(
312
            array('Phone' => $phoneArray) + $timeFilter
313
        )->exclude(array('OrderID' => $order->ID));
314
        foreach ($otherBillingAddresses as $address) {
315
            $otherOrder = $address->Order();
316
            if ($otherOrder && $otherOrder->ID != $order->ID) {
317
                if (!isset($similarArray[$otherOrder->ID])) {
318
                    $similarArray[$otherOrder->ID] = array();
319
                }
320
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
321
            }
322
        }
323
        $otherShippingAddresses = ShippingAddress::get()->filter(
324
            array('ShippingPhone' => $phoneArray) + $timeFilter
325
        )->exclude(array('OrderID' => $order->ID));
@@ 326-334 (lines=9) @@
323
        $otherShippingAddresses = ShippingAddress::get()->filter(
324
            array('ShippingPhone' => $phoneArray) + $timeFilter
325
        )->exclude(array('OrderID' => $order->ID));
326
        foreach ($otherShippingAddresses as $address) {
327
            $otherOrder = $address->Order();
328
            if ($otherOrder && $otherOrder->ID != $order->ID) {
329
                if (!isset($similarArray[$otherOrder->ID])) {
330
                    $similarArray[$otherOrder->ID] = array();
331
                }
332
                $similarArray[$otherOrder->ID]["Phone"] = $otherOrder;
333
            }
334
        }
335
        //adding all emails to security checks
336
        $this->blacklistCheck($phoneArray, 'EcommerceSecurityPhone');
337
@@ 354-362 (lines=9) @@
351
        $otherBillingAddresses = BillingAddress::get()->filter(
352
            array('Address' => $addressArray) + $timeFilter
353
        )->exclude(array('OrderID' => $order->ID));
354
        foreach ($otherBillingAddresses as $address) {
355
            $otherOrder = $address->Order();
356
            if ($otherOrder && $otherOrder->ID != $order->ID) {
357
                if (!isset($similarArray[$otherOrder->ID])) {
358
                    $similarArray[$otherOrder->ID] = array();
359
                }
360
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
361
            }
362
        }
363
        $otherShippingAddresses = ShippingAddress::get()
364
            ->filter(
365
                array('ShippingAddress' => $addressArray) + $timeFilter
@@ 368-376 (lines=9) @@
365
                array('ShippingAddress' => $addressArray) + $timeFilter
366
            )
367
            ->exclude(array('OrderID' => $order->ID));
368
        foreach ($otherShippingAddresses as $address) {
369
            $otherOrder = $address->Order();
370
            if ($otherOrder && $otherOrder->ID != $order->ID) {
371
                if (!isset($similarArray[$otherOrder->ID])) {
372
                    $similarArray[$otherOrder->ID] = array();
373
                }
374
                $similarArray[$otherOrder->ID]["Address"] = $otherOrder;
375
            }
376
        }
377
        $this->blacklistCheck($addressArray, 'EcommerceSecurityAddress');
378
379