Completed
Pull Request — develop (#243)
by Jens
09:17
created

AssetSource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
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 12
loc 12
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 9 9 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
/**
9
 * @package Commercetools\Core\Model\Common
10
 *
11
 * @method string getUri()
12
 * @method AssetSource setUri(string $uri = null)
13
 * @method string getKey()
14
 * @method AssetSource setKey(string $key = null)
15
 * @method AssetDimension getDimensions()
16
 * @method AssetSource setDimensions(AssetDimension $dimensions = null)
17
 * @method string getContentType()
18
 * @method AssetSource setContentType(string $contentType = null)
19
 */
20 View Code Duplication
class AssetSource 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...
21
{
22 1
    public function fieldDefinitions()
23
    {
24
        return [
25 1
            'uri' => [static::TYPE => 'string'],
26 1
            'key' => [static::TYPE => 'string'],
27 1
            'dimensions' => [static::TYPE => '\Commercetools\Core\Model\Common\AssetDimension'],
28 1
            'contentType' => [static::TYPE => 'string'],
29
        ];
30
    }
31
}
32