pug-php/js-phpize

View on GitHub
src/JsPhpize/Parser/TokenCrawler.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using JsPhpize\Parser\count() function in while loops.
Open

        while ($index >= count($this->tokens)) {
            $this->tokens[] = $this->retrieveNext();
        }
Severity: Minor
Found in src/JsPhpize/Parser/TokenCrawler.php by phpmd

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

Inline control structures are not allowed
Open

        while (($next = $this->lexer->next()) && $next->isNeutral());

There are no issues that match your filters.

Category
Status