Cities   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 38
loc 38
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A paginate() 4 4 1
A get() 4 4 1
A neighborhoods() 4 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
namespace JulianoBailao\DomusApi\Endpoints\Secondary;
4
5
use JulianoBailao\DomusApi\Contracts\GetContract;
6
use JulianoBailao\DomusApi\Core\Endpoint;
7
8 View Code Duplication
class Cities extends Endpoint implements GetContract
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
    /**
11
     * Get a page of models list.
12
     *
13
     * @param array $query the request query string.
14
     *
15
     * @return stdObject
16
     */
17 3
    public function paginate(array $query = [])
18
    {
19 3
        return $this->page('operacional/enderecos/localidade', $query);
20
    }
21
22
    /**
23
     * Get a specific model.
24
     *
25
     * @param int $id the model id.
26
     *
27
     * @return stdObject
28
     */
29 3
    public function get($id)
30
    {
31 3
        return $this->run('GET', 'operacional/enderecos/localidade/'.$id);
32
    }
33
34
    /**
35
     * Get te Neighborhoods endpoint.
36
     *
37
     * @param int $cityId
38
     *
39
     * @return Neighborhoods
40
     */
41 18
    public function neighborhoods($cityId)
42
    {
43 18
        return new Neighborhoods($this->client, $cityId);
44
    }
45
}
46