MetadataModel   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 63
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 4 4 1
A setKey() 6 6 1
A getValue() 4 4 1
A setValue() 6 6 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
/*
4
 * This file is part of the zibios/wrike-php-jmsserializer package.
5
 *
6
 * (c) Zbigniew Ślązak
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zibios\WrikePhpJmsserializer\Model\Common;
13
14
use JMS\Serializer\Annotation as SA;
15
use Zibios\WrikePhpJmsserializer\Model\AbstractModel;
16
use Zibios\WrikePhpJmsserializer\Model\ResourceModelInterface;
17
18
/**
19
 * Metadata Model.
20
 */
21 View Code Duplication
class MetadataModel extends AbstractModel implements ResourceModelInterface
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...
22
{
23
    /**
24
     * Key should be less than 50 symbols and match following regular expression ([A-Za-z0-9_-]+).
25
     *
26
     * @SA\Type("string")
27
     * @SA\SerializedName("key")
28
     *
29
     * @var string|null
30
     */
31
    protected $key;
32
33
    /**
34
     * Value should be less than 1000 symbols, compatible with JSON string.
35
     * Use JSON 'null' in order to remove metadata entry.
36
     *
37
     * @SA\Type("string")
38
     * @SA\SerializedName("value")
39
     *
40
     * @var string|null
41
     */
42
    protected $value;
43
44
    /**
45
     * @return null|string
46
     */
47 1
    public function getKey()
48
    {
49 1
        return $this->key;
50
    }
51
52
    /**
53
     * @param null|string $key
54
     *
55
     * @return $this
56
     */
57 1
    public function setKey($key)
58
    {
59 1
        $this->key = $key;
60
61 1
        return $this;
62
    }
63
64
    /**
65
     * @return null|string
66
     */
67 1
    public function getValue()
68
    {
69 1
        return $this->value;
70
    }
71
72
    /**
73
     * @param null|string $value
74
     *
75
     * @return $this
76
     */
77 1
    public function setValue($value)
78
    {
79 1
        $this->value = $value;
80
81 1
        return $this;
82
    }
83
}
84