longitude-one/doctrine-spatial

View on GitHub
lib/LongitudeOne/Spatial/ORM/Query/AST/Functions/AbstractSpatialDQLFunction.php

Summary

Maintainability
A
0 mins
Test Coverage
B
87%

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

TODO found
Open

     * TODO when support for 8.1 will be dropped, this method will only return true.

There are no issues that match your filters.

Category
Status