Completed
Push — master ( 122bdb...4f8f85 )
by Jens
10:49 queued 41s
created

Asset   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 14
loc 14
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 11 11 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\Common;
7
8
use Commercetools\Core\Model\CustomField\CustomFieldObject;
9
10
/**
11
 * @package Commercetools\Core\Model\Common
12
 *
13
 * @method string getId()
14
 * @method Asset setId(string $id = null)
15
 * @method AssetSourceCollection getSources()
16
 * @method Asset setSources(AssetSourceCollection $sources = null)
17
 * @method LocalizedString getName()
18
 * @method Asset setName(LocalizedString $name = null)
19
 * @method LocalizedString getDescription()
20
 * @method Asset setDescription(LocalizedString $description = null)
21
 * @method array getTags()
22
 * @method Asset setTags(array $tags = null)
23
 * @method CustomFieldObject getCustom()
24
 * @method Asset setCustom(CustomFieldObject $custom = null)
25
 */
26 View Code Duplication
class Asset 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...
27
{
28 1
    public function fieldDefinitions()
29
    {
30
        return [
31 1
            'id' => [static::TYPE => 'string'],
32 1
            'sources' => [static::TYPE => '\Commercetools\Core\Model\Common\AssetSourceCollection'],
33 1
            'name' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'],
34 1
            'description' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'],
35 1
            'tags' => [static::TYPE => 'array'],
36 1
            'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'],
37
        ];
38
    }
39
}
40