Completed
Push — master ( 5f432b...5d5b15 )
by Jens
15:50 queued 05:48
created

ReviewCreatedMessage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 7 7 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\Message;
7
8
use Commercetools\Core\Model\Common\DateTimeDecorator;
9
use Commercetools\Core\Model\Common\Reference;
10
use Commercetools\Core\Model\Review\Review;
11
12
/**
13
 * @package Commercetools\Core\Model\Message
14
 * @link https://dev.commercetools.com/http-api-projects-messages.html#reviewcreated-message
15
 * @method string getId()
16
 * @method ReviewCreatedMessage setId(string $id = null)
17
 * @method int getVersion()
18
 * @method ReviewCreatedMessage setVersion(int $version = null)
19
 * @method DateTimeDecorator getCreatedAt()
20
 * @method ReviewCreatedMessage setCreatedAt(\DateTime $createdAt = null)
21
 * @method DateTimeDecorator getLastModifiedAt()
22
 * @method ReviewCreatedMessage setLastModifiedAt(\DateTime $lastModifiedAt = null)
23
 * @method int getSequenceNumber()
24
 * @method ReviewCreatedMessage setSequenceNumber(int $sequenceNumber = null)
25
 * @method Reference getResource()
26
 * @method ReviewCreatedMessage setResource(Reference $resource = null)
27
 * @method int getResourceVersion()
28
 * @method ReviewCreatedMessage setResourceVersion(int $resourceVersion = null)
29
 * @method string getType()
30
 * @method ReviewCreatedMessage setType(string $type = null)
31
 * @method Review getReview()
32
 * @method ReviewCreatedMessage setReview(Review $review = null)
33
 */
34 View Code Duplication
class ReviewCreatedMessage extends Message
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...
35
{
36
    const MESSAGE_TYPE = 'ReviewCreated';
37
38
    public function fieldDefinitions()
39
    {
40
        $definitions = parent::fieldDefinitions();
41
        $definitions['review'] = [static::TYPE => '\Commercetools\Core\Model\Review\Review'];
42
43
        return $definitions;
44
    }
45
}
46