Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — master ( 3bb9ff...64486c )
by Jérémiah
05:40
created

ResolverTaggedServiceMappingPass   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 21.74 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 1
dl 5
loc 23
ccs 8
cts 10
cp 0.8
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTagName() 0 4 1
A checkRequirements() 5 10 3
A getResolverServiceID() 0 4 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
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
13
14
class ResolverTaggedServiceMappingPass extends TaggedServiceMappingPass
15
{
16 18
    protected function getTagName()
17
    {
18 18
        return 'overblog_graphql.resolver';
19
    }
20
21 18
    protected function checkRequirements($id, array $tag)
22
    {
23 18
        parent::checkRequirements($id, $tag);
24
25 18 View Code Duplication
        if (isset($tag['method']) && !is_string($tag['method'])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across 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...
26
            throw new \InvalidArgumentException(
27
                sprintf('Service tagged "%s" must have valid "method" argument.', $id)
28
            );
29
        }
30 18
    }
31
32 18
    protected function getResolverServiceID()
33
    {
34 18
        return 'overblog_graphql.resolver_resolver';
35
    }
36
}
37