StockItemReserve   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 119
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 119
loc 119
ccs 38
cts 38
cp 1
rs 10
c 0
b 0
f 0
wmc 15
lcom 0
cbo 0

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getEan() 4 4 1
A setEan() 4 4 1
A getAmount() 4 4 1
A setAmount() 4 4 1
A getMagentoStockAmount() 4 4 1
A setMagentoStockAmount() 4 4 1
A getQuoteItemId() 4 4 1
A setQuoteItemId() 4 4 1
A getProductId() 4 4 1
A setProductId() 4 4 1
A getOrderItemId() 4 4 1
A setOrderItemId() 4 4 1
A getCreatedAt() 4 4 1
A setCreatedAt() 4 4 1
A _construct() 4 4 1

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
4
namespace Stockbase\Integration\Model;
5
6
use Magento\Framework\Model\AbstractModel;
7
8
/**
9
 * Class StockItemReserve
10
 */
11 View Code Duplication
class StockItemReserve extends AbstractModel
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...
12
{
13
    /**
14
     * @return mixed
15
     */
16 1
    public function getEan()
17
    {
18 1
        return $this->getData('ean');
19
    }
20
21
    /**
22
     * @param string $ean
23
     */
24 1
    public function setEan($ean)
25
    {
26 1
        $this->setData('ean', $ean);
27 1
    }
28
29
    /**
30
     * @return mixed
31
     */
32 1
    public function getAmount()
33
    {
34 1
        return $this->getData('amount');
35
    }
36
37
    /**
38
     * @param string $amount
39
     */
40 1
    public function setAmount($amount)
41
    {
42 1
        $this->setData('amount', $amount);
43 1
    }
44
45
    /**
46
     * @return mixed
47
     */
48 1
    public function getMagentoStockAmount()
49
    {
50 1
        return $this->getData('magento_stock_amount');
51
    }
52
53
    /**
54
     * @param string $magentoStockAmount
55
     */
56 1
    public function setMagentoStockAmount($magentoStockAmount)
57
    {
58 1
        $this->setData('magento_stock_amount', $magentoStockAmount);
59 1
    }
60
61
    /**
62
     * @return mixed
63
     */
64 1
    public function getQuoteItemId()
65
    {
66 1
        return $this->getData('quote_item_id');
67
    }
68
69
    /**
70
     * @param string $quoteItemId
71
     */
72 1
    public function setQuoteItemId($quoteItemId)
73
    {
74 1
        $this->setData('quote_item_id', $quoteItemId);
75 1
    }
76
77
    /**
78
     * @return mixed
79
     */
80 1
    public function getProductId()
81
    {
82 1
        return $this->getData('product_id');
83
    }
84
85
    /**
86
     * @param string $productId
87
     */
88 1
    public function setProductId($productId)
89
    {
90 1
        $this->setData('product_id', $productId);
91 1
    }
92
93
    /**
94
     * @return mixed
95
     */
96 1
    public function getOrderItemId()
97
    {
98 1
        return $this->getData('order_item_id');
99
    }
100
101
    /**
102
     * @param string $orderItemId
103
     */
104 1
    public function setOrderItemId($orderItemId)
105
    {
106 1
        $this->setData('order_item_id', $orderItemId);
107 1
    }
108
109
    /**
110
     * @return mixed
111
     */
112 1
    public function getCreatedAt()
113
    {
114 1
        return $this->getData('created_at');
115
    }
116
117
    /**
118
     * @param string $createdAt
119
     */
120 1
    public function setCreatedAt($createdAt)
121
    {
122 1
        $this->setData('created_at', $createdAt);
123 1
    }
124
125 7
    protected function _construct()
126
    {
127 7
        $this->_init(\Stockbase\Integration\Model\ResourceModel\StockItemReserve::class);
128 7
    }
129
}
130