longitude-one/doctrine-spatial

View on GitHub

Showing 79 of 79 total issues

Avoid unused parameters such as '$type'.
Open

    public function convertToPhpValueSql(AbstractSpatialType $type, $sqlExpr): string

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

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

Avoid unused parameters such as '$type'.
Open

    public function convertToDatabaseValueSql(AbstractSpatialType $type, $sqlExpr): string

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

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

Avoid unused parameters such as '$srid'.
Open

    public function getSqlDeclaration(array $column, ?AbstractSpatialType $type = null, ?int $srid = null): string

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

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

Avoid unused private methods such as 'toStringMultiPolygon'.
Open

    private function toStringMultiPolygon(array $multiPolygon): string
    {
        $strings = null;

        foreach ($multiPolygon as $polygon) {

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 using LongitudeOne\Spatial\PHP\Types\count() function in for loops.
Open

        for ($i = 0; $i < count($this->lineStrings); ++$i) {
            $lineStrings[] = $this->getLineString($i);
        }

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

Avoid using LongitudeOne\Spatial\ORM\Query\AST\Functions\count() function in while loops.
Open

        while (count($this->geometryExpression) < $this->getMinParameter()
            || ((count($this->geometryExpression) < $this->getMaxParameter())
                && TokenType::T_CLOSE_PARENTHESIS != $lexer->lookahead?->type)
        ) {
            $parser->match(TokenType::T_COMMA);

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

Avoid using LongitudeOne\Spatial\ORM\Query\AST\Functions\count() function in while loops.
Open

        while (count($this->geometryExpression) < $this->getMinParameter()
            || ((count($this->geometryExpression) < $this->getMaxParameter())
                && TokenType::T_CLOSE_PARENTHESIS != $lexer->lookahead?->type)
        ) {
            $parser->match(TokenType::T_COMMA);

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

Avoid using LongitudeOne\Spatial\PHP\Types\count() function in for loops.
Open

        for ($i = 0; $i < count($this->rings); ++$i) {
            $rings[] = $this->getRing($i);
        }

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

Avoid using LongitudeOne\Spatial\PHP\Types\count() function in for loops.
Open

        for ($i = 0; $i < count($this->polygons); ++$i) {
            $polygons[] = $this->getPolygon($i);
        }

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

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

    protected function validateArguments(array $argv, string $caller): array
    {
        $argc = count($argv);

        if (1 == $argc && is_array($argv[0])) {

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

Avoid using LongitudeOne\Spatial\PHP\Types\count() function in for loops.
Open

        for ($i = 0; $i < count($this->points); ++$i) {
            $points[] = $this->getPoint($i);
        }

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

Source https://phpmd.org/rules/design.html#countinloopexpression

Line exceeds 120 characters; contains 122 characters
Open

     * @param (float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[] $lineString line string to validate

Line exceeds 120 characters; contains 123 characters
Open

     * @param ((float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[])[] $lineStrings array of linestring

Line exceeds 120 characters; contains 141 characters
Open

     * @param ((float|int)[][][]|LineStringInterface[]|MultiPointInterface[]|PointInterface[][]|PolygonInterface)[] $polygons polygons to set

Line exceeds 120 characters; contains 141 characters
Open

     * @param ((float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[])[] $lineStrings the array of line strings to validate

Line exceeds 120 characters; contains 130 characters
Open

     * @param (float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[] $points array of geometric data to validate

Line exceeds 120 characters; contains 159 characters
Open

     * @param ((float|int)[][][]|LineStringInterface[]|MultiPointInterface[]|PointInterface[][]|PolygonInterface)[] $polygons the array of polygons to validate

Line exceeds 120 characters; contains 133 characters
Open

     * @param (float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[] $lineString the line string to add to Geometry

Line exceeds 120 characters; contains 133 characters
Open

     * @param null|int                                                                     $srid  Spatial Reference System Identifier

Line exceeds 120 characters; contains 123 characters
Open

     * @param ((float|int)[][]|LineStringInterface|MultiPointInterface|PointInterface[])[] $lineStrings array of LineString
Severity
Category
Status
Source
Language