Completed
Push — master ( 44676f...b7bc18 )
by Jens
13:18
created

Project   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 23
loc 23
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 20 20 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
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Project;
7
8
use Commercetools\Core\Model\Common\JsonObject;
9
use Commercetools\Core\Model\Common\Collection;
10
use Commercetools\Core\Model\Common\DateTimeDecorator;
11
use Commercetools\Core\Model\Message\MessagesConfiguration;
12
use DateTime;
13
14
/**
15
 * @package Commercetools\Core\Model\Project
16
 * @link https://dev.commercetools.com/http-api-projects-project.html#project
17
 * @method string getKey()
18
 * @method Project setKey(string $key = null)
19
 * @method string getName()
20
 * @method Project setName(string $name = null)
21
 * @method Collection getCountries()
22
 * @method Project setCountries(Collection $countries = null)
23
 * @method Collection getCurrencies()
24
 * @method Project setCurrencies(Collection $currencies = null)
25
 * @method Collection getLanguages()
26
 * @method Project setLanguages(Collection $languages = null)
27
 * @method DateTimeDecorator getCreatedAt()
28
 * @method Project setCreatedAt(DateTime $createdAt = null)
29
 * @method DateTimeDecorator getTrialUntil()
30
 * @method Project setTrialUntil(DateTime $trialUntil = null)
31
 * @method MessagesConfiguration getMessages()
32
 * @method Project setMessages(MessagesConfiguration $messages = null)
33
 * @method int getVersion()
34
 * @method Project setVersion(int $version = null)
35
 */
36 View Code Duplication
class Project extends JsonObject
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...
37
{
38 7
    public function fieldDefinitions()
39
    {
40
        return [
41 7
            'version' => [static::TYPE => 'int'],
42 7
            'key' => [static::TYPE => 'string'],
43 7
            'name' => [static::TYPE => 'string'],
44 7
            'countries' => [static::TYPE => Collection::class],
45 7
            'currencies' => [static::TYPE => Collection::class],
46 7
            'languages' => [static::TYPE => Collection::class],
47
            'createdAt' => [
48 7
                static::TYPE => DateTime::class,
49 7
                static::DECORATOR => DateTimeDecorator::class
50
            ],
51
            'trialUntil' => [
52 7
                static::TYPE => DateTime::class,
53 7
                static::DECORATOR => DateTimeDecorator::class
54
            ],
55 7
            'messages' => [static::TYPE => MessagesConfiguration::class]
56
        ];
57
    }
58
}
59