Passed
Push — master ( d898ef...46a72e )
by Christopher
02:06 queued 27s
created

xsHexBinary   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 21
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
A isOK() 5 5 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
namespace AlgoWeb\xsdTypes;
4
5
/**
6
 * The xsd:hexBinary type represents binary data as a sequence of binary octets. It uses hexadecimal encoding, where
7
 * each binary octet is a two-character hexadecimal number. Lowercase and uppercase letters A through F are permitted.
8
 * For example, 0FB8 and 0fb8 are two equal xsd:hexBinary representations consisting of two octets.
9
 * @package AlgoWeb\xsdTypes
10
 */
11 View Code Duplication
class xsHexBinary extends xsAnySimpleType
1 ignored issue
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...
12
{
13
    use LengthTrait;
14
15
    /**
16
     * Construct
17
     *
18
     * @param string $value
19
     */
20
    public function __construct($value)
21
    {
22
        parent::__construct($value);
23
        $this->setWhiteSpaceFacet("collapse");
24
    }
25
26
    protected function isOK()
27
    {
28
        $this->checkMaxLength($this->__value);
29
        $this->checkMinLength($this->__value);
30
    }
31
}
32