FragmentDefinition   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 28
loc 28
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 14 14 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 Fubhy\GraphQL\Language\Node;
4
5
use Fubhy\GraphQL\Language\Location;
6
use Fubhy\GraphQL\Language\Node;
7
8 View Code Duplication
class FragmentDefinition extends Node implements DefinitionInterface
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...
9
{
10
    const KIND = Node::KIND_FRAGMENT_DEFINITION;
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param \Fubhy\GraphQL\Language\Node\Name $name
16
     * @param \Fubhy\GraphQL\Language\Node\NamedType $typeCondition
17
     * @param \Fubhy\GraphQL\Language\Node\Directive[] $directives
18
     * @param \Fubhy\GraphQL\Language\Node\SelectionSet $selectionSet
19
     * @param \Fubhy\GraphQL\Language\Location $location
20
     */
21 36
    public function __construct(
22
        Name $name,
23
        NamedType $typeCondition,
24
        array $directives = [],
25
        SelectionSet $selectionSet,
26
        Location $location = NULL
27
    ) {
28 36
        parent::__construct($location, [
29 36
            'name' => $name,
30 36
            'typeCondition' => $typeCondition,
31 36
            'directives' => $directives,
32 36
            'selectionSet' => $selectionSet,
33 36
        ]);
34 36
    }
35
}
36