Completed
Push — master ( ff5b0d...faa513 )
by Tobias
05:10 queued 02:50
created

Interview   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 54.55 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 12
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A show() 12 12 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 Happyr\ApiClient\Api;
4
5
use Happyr\ApiClient\Assert;
6
use Psr\Http\Message\ResponseInterface;
7
use Happyr\ApiClient\Model\Dimension\Interview as InterviewModel;
8
9
/**
10
 * @author Tobias Nyholm <[email protected]>
11
 */
12
final class Interview extends HttpApi
13
{
14
    /**
15
     * @param $user
16
     * @param array $patterns
17
     * @param array $params   valid keys are norm and locale
18
     *
19
     * @return InterviewModel|ResponseInterface
20
     */
21 View Code Duplication
    public function show($user, array $patterns, array $params)
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...
22
    {
23
        Assert::stringNotEmpty($user);
24
        Assert::notEmpty($patterns);
25
26
        $params['user'] = $user;
27
        $params['pattern'] = implode(',', $patterns);
28
29
        $response = $this->httpGet('/api/interview/guide', $params);
30
31
        return $this->hydrateResponse($response, InterviewModel::class);
32
    }
33
}
34