GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#14)
by Michael
15:13 queued 05:39
created

EbayEnterprise_Tax_Helper_Item_Selection   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 45
loc 45
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * Copyright (c) 2013-2014 eBay Enterprise, Inc.
4
 *
5
 * NOTICE OF LICENSE
6
 *
7
 * This source file is subject to the Open Software License (OSL 3.0)
8
 * that is bundled with this package in the file LICENSE.md.
9
 * It is also available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * @copyright   Copyright (c) 2013-2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
13
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
14
 */
15
16
class EbayEnterprise_Tax_Helper_Item_Selection
17
{
18
    /**
19
     * Filter out the children of configurable products.
20
     *
21
     * @param Mage_Sales_Model_Quote_Item_Abstract[]
22
     * @return Mage_Sales_Model_Quote_Item_Abstract[]
23
     */
24
    public function selectFrom(array $items)
25
    {
26
        $predicate = function (Mage_Sales_Model_Quote_Item_Abstract $item) {
27
            $parentItem = $item->getParentItem();
28
            return !($parentItem && $parentItem->getProductType() === Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE);
29
        }
30
        return array_filter($items, $predicate);
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_RETURN
Loading history...
31
    }
32
}
33