Code Duplication    Length = 6-7 lines in 2 locations

code/model/process/OrderStatusLog_SecurityCheck.php 2 locations

@@ 353-358 (lines=6) @@
350
                )
351
            )
352
            ->exclude(array('ID' => $order->ID));
353
        foreach ($otherOrders as $otherOrder) {
354
            if (!isset($similarArray[$otherOrder->ID])) {
355
                $similarArray[$otherOrder->ID] = array();
356
            }
357
            $similarArray[$otherOrder->ID]["Email"] = $otherOrder;
358
        }
359
        //check emails from billing address
360
        $emailArray = array();
361
        if ($billingAddress) {
@@ 370-376 (lines=7) @@
367
        $otherBillingAddresses = BillingAddress::get()->filter(
368
            array('Email' => $emailArray) + $timeFilter
369
        )->exclude(array('OrderID' => $order->ID));
370
        foreach ($otherBillingAddresses as $address) {
371
            $otherOrder = $address->Order();
372
            if (!isset($similarArray[$otherOrder->ID])) {
373
                $similarArray[$otherOrder->ID] = array();
374
            }
375
            $similarArray[$otherOrder->ID]["Email"] = $otherOrder;
376
        }
377
        //adding all emails to security checks
378
        $this->blacklistCheck($emailArray, 'EcommerceSecurityEmail');
379