Completed
Pull Request — master (#293)
by
unknown
21:47 queued 19:59
created

Zone::queryZone()   C

Complexity

Conditions 11
Paths 41

Size

Total Lines 54

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 37
CRAP Score 11.4872

Importance

Changes 0
Metric Value
cc 11
nc 41
nop 2
dl 0
loc 54
ccs 37
cts 44
cp 0.8409
crap 11.4872
rs 6.8569
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
namespace Qiniu;
3
4
use Qiniu\Region;
5
6
class Zone extends Region{
7
8
    public static function zonez0()
9
    {
10
        return parent::Regionz0();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (Regionz0() instead of zonez0()). Are you sure this is correct? If so, you might want to change this to $this->Regionz0().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
11
    }
12
13
    public static function zonez1()
14
    {
15
        return parent::Regionz1();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (Regionz1() instead of zonez1()). Are you sure this is correct? If so, you might want to change this to $this->Regionz1().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
16
    }
17
18
    public static function zonez2()
19
    {
20
        return parent::Regionz2();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (Regionz2() instead of zonez2()). Are you sure this is correct? If so, you might want to change this to $this->Regionz2().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
21
    }
22
23
    public static function zoneAs0()
24
    {
25
        return parent::RegionAs0();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (RegionAs0() instead of zoneAs0()). Are you sure this is correct? If so, you might want to change this to $this->RegionAs0().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
26
    }
27
28
    public static function zoneNa0()
29
    {
30
        return parent::RegionNa0();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (RegionNa0() instead of zoneNa0()). Are you sure this is correct? If so, you might want to change this to $this->RegionNa0().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
31
    }
32
33
    public static function qvmZonez0()
34
    {
35
        return parent::qvmRegionZ0();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (qvmRegionZ0() instead of qvmZonez0()). Are you sure this is correct? If so, you might want to change this to $this->qvmRegionZ0().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
36
    }
37
38
    public static function qvmZonez1()
39
    {
40
        return parent::qvmRegionZ1();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (qvmRegionZ1() instead of qvmZonez1()). Are you sure this is correct? If so, you might want to change this to $this->qvmRegionZ1().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
41
    }
42
}