Completed
Pull Request — master (#2)
by
unknown
02:20
created

Product   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 114
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 114
loc 114
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createInstance() 10 10 2

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
 * Created by PhpStorm.
4
 * User: luna
5
 * Date: 07/04/17
6
 * Time: 17:01
7
 */
8
9
namespace Padosoft\AffiliateNetwork;
10
11
12 View Code Duplication
class Product
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...
13
{
14
    /**
15
     * @var int
16
     */
17
    public $merchant_ID=0;
18
19
    /**
20
     * @var string
21
     */
22
    public $merchant_name='';
23
24
    /**
25
     * @var string
26
     */
27
    public $name = '';
28
29
    /**
30
     * @var string
31
     */
32
    public $modified = '';
33
34
    /**
35
     * @var double
36
     */
37
    public $price = 0.0;
38
39
    /**
40
     * @var string
41
     */
42
    public $currency = '';
43
44
    /**
45
     * @var string
46
     */
47
    public $ppv = '';
48
49
    /**
50
     * @var string
51
     */
52
    public $ppc = '';
53
54
    //adspaceId = 0;
55
56
    /**
57
     * @var string
58
     */
59
    public $description = '';
60
61
    /**
62
     * @var string
63
     */
64
    public $manufacturer = '';
65
66
    /**
67
     * @var string
68
     */
69
    public $ean = '';
70
71
    /**
72
     * @var string
73
     */
74
    public $deliveryTime = '';
75
76
    /**
77
     * @var double
78
     */
79
    public $priceOld = 0.0;
80
81
    /**
82
     * @var string
83
     */
84
    public $shippingCosts = '';
85
86
    /**
87
     * @var string
88
     */
89
    public $shipping = '';
90
91
    /**
92
     * @var string
93
     */
94
    public $merchantCategory;
95
96
    /**
97
     * @var string
98
     */
99
    public $merchantProductId = '';
100
101
    /**
102
     * @var string
103
     */
104
    public $id = '';
105
106
    /**
107
     * @var string
108
     */
109
    public $image = '';
110
111
    /**
112
     * @method createInstance
113
     * @return obj istance
114
     */
115
    public static function createInstance()
116
    {
117
        $obj = null;
118
        try {
119
            $obj = new Product();
120
        } catch (\Exception $e) {
121
            throw new \Exception('Error creating instance Deal - ' . $e->getMessage());
122
        }
123
        return $obj;
124
    }
125
}
126