src/Statement/CommandList.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using ECL\Statement\count() function in for loops.
Open

        for($i = 0; $i < count($this->commands); ++$i) {
            $command = $this->commands[$i];
            $curr_result = $command->process($table);
            $table[\ECL\SymbolTable::DEFAULT_SYMBOL] = $curr_result;

Severity: Minor
Found in src/Statement/CommandList.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

The variable $curr_result is not named in camelCase.
Open

    public function process(\ECL\SymbolTable $table) {
        $results = [];

        // Loop over every Command and process it.
        for($i = 0; $i < count($this->commands); ++$i) {
Severity: Minor
Found in src/Statement/CommandList.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $curr_result is not named in camelCase.
Open

    public function process(\ECL\SymbolTable $table) {
        $results = [];

        // Loop over every Command and process it.
        for($i = 0; $i < count($this->commands); ++$i) {
Severity: Minor
Found in src/Statement/CommandList.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $curr_result is not named in camelCase.
Open

    public function process(\ECL\SymbolTable $table) {
        $results = [];

        // Loop over every Command and process it.
        for($i = 0; $i < count($this->commands); ++$i) {
Severity: Minor
Found in src/Statement/CommandList.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status