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.

CustomerCheckout::__construct()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 20

Duplication

Lines 24
Ratio 100 %

Importance

Changes 0
Metric Value
dl 24
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 20
nc 1
nop 10

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace Magium\Magento\Actions\Checkout;
4
5
use Magium\Magento\Actions\Checkout\Steps\CustomerBillingAddress;
6
use Magium\Magento\Actions\Checkout\Steps\LogInCustomer;
7
use Magium\Magento\Actions\Checkout\Steps\PaymentMethod;
8
use Magium\Magento\Actions\Checkout\Steps\PlaceOrder;
9
use Magium\Magento\Actions\Checkout\Steps\ReviewOrder;
10
use Magium\Magento\Actions\Checkout\Steps\SelectCustomerCheckout;
11
use Magium\Magento\Actions\Checkout\Steps\ShippingAddress;
12
use Magium\Magento\Actions\Checkout\Steps\ShippingMethod;
13
use Magium\Magento\Extractors\Checkout\CartSummary;
14
use Magium\Magento\Extractors\Checkout\OrderId;
15
use Magium\Magento\Navigators\Checkout\Checkout;
16
use Magium\Magento\Navigators\Checkout\CheckoutStart;
17
use Magium\Magento\Themes\OnePageCheckout\AbstractThemeConfiguration;
18
19 View Code Duplication
class CustomerCheckout extends AbstractCheckout
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
{
21
    const ACTION = 'Checkout\CustomerCheckout';
22
23
    public function __construct(
24
        CheckoutStart             $navigator,
25
        AbstractThemeConfiguration    $theme,
0 ignored issues
show
Unused Code introduced by
The parameter $theme is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
        LogInCustomer           $logInCustomer,
27
        CustomerBillingAddress  $billingAddress,
28
        ShippingAddress         $shippingAddress,
29
        ShippingMethod          $shippingMethod,
30
        PaymentMethod           $paymentMethod,
31
        CartSummary             $cartSummary,
32
        PlaceOrder              $placeOrder,
33
        OrderId                 $orderIdExtractor
34
    )
35
    {
36
        $this->addStep($navigator);
37
        $this->addStep($logInCustomer);
38
        $this->addStep($billingAddress);
39
        $this->addStep($shippingAddress);
40
        $this->addStep($shippingMethod);
41
        $this->addStep($paymentMethod);
42
        $this->addStep($cartSummary);
43
        $this->addStep($placeOrder);
44
        $this->addStep($orderIdExtractor);
45
46
    }
47
48
}