Completed
Push — master ( 74bae6...8bdcbb )
by Zbigniew
03:01
created

AccountResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 44.44 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 8
loc 18
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getResourceMethodConfiguration() 8 8 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 zibios/wrike-php-library package.
5
 *
6
 * (c) Zbigniew Ślązak
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 Zibios\WrikePhpLibrary\Resource;
13
14
use Zibios\WrikePhpLibrary\Enum\Api\RequestPathFormatEnum;
15
use Zibios\WrikePhpLibrary\Enum\Api\ResourceMethodEnum;
16
use Zibios\WrikePhpLibrary\Resource\Traits\GetAllTrait;
17
use Zibios\WrikePhpLibrary\Resource\Traits\GetByIdTrait;
18
use Zibios\WrikePhpLibrary\Resource\Traits\UpdateTrait;
19
20
/**
21
 * Account Resource.
22
 */
23
class AccountResource extends AbstractResource
24
{
25
    use GetAllTrait;
26
    use GetByIdTrait;
27
    use UpdateTrait;
28
29
    /**
30
     * @return array
31
     */
32 6 View Code Duplication
    protected function getResourceMethodConfiguration()
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...
33
    {
34
        return [
35 6
            ResourceMethodEnum::GET_ALL => RequestPathFormatEnum::ACCOUNTS,
36
            ResourceMethodEnum::GET_BY_ID => RequestPathFormatEnum::ACCOUNTS_BY_ID,
37
            ResourceMethodEnum::UPDATE => RequestPathFormatEnum::ACCOUNTS_BY_ID,
38
        ];
39
    }
40
}
41