Passed
Pull Request — master (#43)
by Christopher
07:20 queued 03:38
created

TMultiplicityModeTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 10
Duplicated Lines 70 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 7
loc 10
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A TMultiplicityTrait::isTMultiplicityValid() 7 7 4

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\ODataMetadata\MetadataV3\edm\IsOKTraits;
4
5
trait TMultiplicityTrait
6
{
7 View Code Duplication
    public function isTMultiplicityValid($string)
0 ignored issues
show
Duplication introduced by
This method 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...
8
    {
9
        if (!is_string($string)) {
10
            throw new \InvalidArgumentException("Input must be a string");
11
        }
12
        return '0..1' == $string || '1' == $string || '*' == $string;
13
    }
14
}
15