lancew/DojoList

View on GitHub

Showing 1,940 of 1,940 total issues

The function search() has an NPath complexity of 216. The configured NPath complexity threshold is 200.
Open

function search() 
{
    $term = params('term');
    set('term', $term);
    $term = strtolower($term);
Severity: Minor
Found in controllers/main.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

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

The method search uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $result
                 .= '<a href="'.
                 url_for('dojo', $item).
                 '">'.
Severity: Minor
Found in controllers/main.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused local variables such as '$dojo'.
Open

    foreach ($xml->Dojo as $dojo) {
Severity: Minor
Found in lib/dojo.model.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused parameters such as '$callback'.
Open

function autoload_controller($callback)
Severity: Minor
Found in lib/limonade/abstract.php by phpmd

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 '$errstr'.
Open

function not_found($errno, $errstr, $errfile=null, $errline=null)
Severity: Minor
Found in lib/limonade/abstract.php by phpmd

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 '$pattern'.
Open

function assert_no_match($pattern, $string, $message = '<2> expected to not match regular expression <1>') {
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

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 local variables such as '$output'.
Open

  return $output;
Severity: Minor
Found in lib/limonade/abstract.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused parameters such as '$value'.
Open

function assert_identical($expected, $value, $message = '<1> should be identical to <2>')
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

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 local variables such as '$count'.
Open

   $count = is_string($value) ? 'strlen' : 'count';
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

The method Create_dojo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                          $new_child = 'data:'.$file["CoachPhoto"]["type"].';base64,';
                          $file = file_get_contents($file['CoachPhoto']['tmp_name']);
                          $new_child .= base64_encode($file);
                          $new1->addChild('CoachPhoto', $new_child);
Severity: Minor
Found in lib/dojo.model.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused local variables such as '$trigger_errors'.
Open

  $trigger_errors = count($GLOBALS["limonade"]["test_errors"]);
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

The method assert_header uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

  } else {
      $regex = "/^{$regex_header}(:.*?)?$/ism";
  }
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$object'.
Open

function assert_instance_of($class, $object, $message = '<2> is not an instance of class <1>') {
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

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

The method Dojo_Create_add uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // set the error code so that we can display it
            halt('Failed to add new Dojo: '.$resp->error);

        }
Severity: Minor
Found in controllers/dojo.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method search uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $result
             .= '<a href="'.
             url_for('dojo', $dojo->DojoName).
             '">'.
Severity: Minor
Found in controllers/main.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$route'.
Open

function autorender($route)
Severity: Minor
Found in lib/limonade/abstract.php by phpmd

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 '$value'.
Open

function assert_null($value, $message = '<1> should be NULL')
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

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 '$length'.
Open

function assert_length_of($value, $length, $message = '<1> expected to be of length <2>') {
Severity: Minor
Found in lib/limonade/assertions.php by phpmd

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

The method test_case uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

   {
      
   }
Severity: Minor
Found in lib/limonade/tests.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused local variables such as '$v'.
Open

  foreach($args as $k => $v)
Severity: Minor
Found in lib/limonade.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Severity
Category
Status
Source
Language