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.

AbstractExtendingClassGenerator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 33.33 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 10
loc 30
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFilename() 10 10 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 declare(strict_types=1);
2
3
namespace ApiClients\Tools\ResourceGenerator\FileGenerators;
4
5
use ApiClients\Tools\ResourceGenerator\FileGeneratorInterface;
6
7
abstract class AbstractExtendingClassGenerator implements FileGeneratorInterface
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $yaml;
13
14
    /**
15
     * InterfaceGenerator constructor.
16
     * @param array $yaml
17
     */
18 1
    public function __construct(array $yaml)
19
    {
20 1
        $this->yaml = $yaml;
21 1
    }
22
23
    /**
24
     * @return string
25
     */
26 1 View Code Duplication
    public function getFilename(): 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...
27
    {
28 1
        return $this->yaml['src']['path'] .
29 1
            DIRECTORY_SEPARATOR .
30
            static::NAMESPACE .
31 1
            DIRECTORY_SEPARATOR .
32 1
            str_replace('\\', DIRECTORY_SEPARATOR, $this->yaml['class']) .
33 1
            '.php'
34
        ;
35
    }
36
}
37