GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Costs::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15

Duplication

Lines 15
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 2.2109

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 3
dl 15
loc 15
ccs 5
cts 8
cp 0.625
crap 2.2109
rs 9.7666
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of gpupo/similarity
5
 * Created by Gilmar Pupo <[email protected]>
6
 * For the information of copyright and license you should read the file
7
 * LICENSE which is distributed with this source code.
8
 * Para a informação dos direitos autorais e de licença você deve ler o arquivo
9
 * LICENSE que é distribuído com este código-fonte.
10
 * Para obtener la información de los derechos de autor y la licencia debe leer
11
 * el archivo LICENSE que se distribuye con el código fuente.
12
 * For more information, see <https://www.gpupo.com/>.
13
 */
14
15
namespace Gpupo\Similarity\Input;
16
17
class Costs extends \ArrayObject
18
{
19 82 View Code Duplication
    public function __construct($first = null, $second = null,
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...
20
        array $third = null)
21
    {
22 82
        if (is_array($first)) {
23 82
            $array = array_combine(['insertion', 'replacement', 'deletion'], $first);
24
        } else {
25
            $array = [
26
                'insertion'   => $first,
27
                'replacement' => $second,
28
                'deletion'    => $third,
29
            ];
30
        }
31
32 82
        parent::__construct(array_map('intVal', $array), parent::ARRAY_AS_PROPS);
33 82
    }
34
}
35