creof/wkb-parser

View on GitHub

Showing 33 of 33 total issues

Avoid unused private methods such as 'multiCurve'.
Open

    private function multiCurve()
    {
        $values = array();
        $count  = $this->readCount();

Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

Avoid unused private methods such as 'geometryCollection'.
Open

    private function geometryCollection()
    {
        $values = array();
        $count  = $this->readCount();

Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

The method getTypeName() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
Open

    private function getTypeName($type)
    {
        switch ($this->getTypePrimitive($type)) {
            case (self::WKB_TYPE_POINT):
                $typeName = self::TYPE_POINT;
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

Line exceeds 120 characters; contains 216 characters
Open

                    throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_MULTICURVE, array(self::WKB_TYPE_LINESTRING, self::WKB_TYPE_CIRCULARSTRING, self::WKB_TYPE_COMPOUNDCURVE)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 189 characters
Open

                    throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_COMPOUNDCURVE, array(self::WKB_TYPE_LINESTRING, self::WKB_TYPE_CIRCULARSTRING)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 146 characters
Open

        throw new UnexpectedValueException(sprintf('%s with unsupported dimensions 0x%2$X (%2$d)', $this->getTypeName($this->type), $dimensions));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 159 characters
Open

                    throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_POLYHEDRALSURFACE, array(self::WKB_TYPE_POLYGON)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 146 characters
Open

                throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_MULTIPOINT, array(self::WKB_TYPE_POINT)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 126 characters
Open

            throw new $e($e->getMessage() . ' at byte ' . $this->reader->getLastPosition(), $e->getCode(), $e->getPrevious());
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 218 characters
Open

                    throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_CURVEPOLYGON, array(self::WKB_TYPE_LINESTRING, self::WKB_TYPE_CIRCULARSTRING, self::WKB_TYPE_COMPOUNDCURVE)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 183 characters
Open

                    throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_MULTISURFACE, array(self::WKB_TYPE_POLYGON, self::WKB_TYPE_CURVEPOLYGON)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 156 characters
Open

                throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_MULTILINESTRING, array(self::WKB_TYPE_LINESTRING)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer

Line exceeds 120 characters; contains 150 characters
Open

                throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_MULTIPOLYGON, array(self::WKB_TYPE_POLYGON)));
Severity: Minor
Found in lib/CrEOF/Geo/WKB/Parser.php by phpcodesniffer
Severity
Category
Status
Source
Language