lancew/DojoList

View on GitHub

Showing 1,940 of 1,940 total issues

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

                } else {
                    $newxml .= $dojo->asXML();
                }
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 function Create_dojo() has 118 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

function Create_dojo($dojo, $file = null)
{
    Backup_data();
    
    $xml = Load_Xml_data();
Severity: Minor
Found in lib/dojo.model.php by phpmd

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["DojoLogo"]["type"].';base64,';
                          $file = file_get_contents($file['DojoLogo']['tmp_name']);
                          $new_child .= base64_encode($file);
                          $new1->addChild('DojoLogo', $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 parameters such as '$class'.
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 Admin_login uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        return html('admin/index_login.html.php');
    }
Severity: Minor
Found in controllers/admin.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 {

        //Find partial matches
        $Dojo = Sorted_dojo();
        foreach ( $Dojo as $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

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

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

function assert_not_null($value, $message = '<1> should not 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 '$value'.
Open

function assert_not_equal($expected, $value, $message = '<1> should not equal 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 parameters such as '$string'.
Open

function assert_match($pattern, $string, $message = '<2> expected to 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 '$predicate'.
Open

  $predicate = 'is_' . strtolower(is_string($type) ? $type : gettype($type));
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 Admin_index uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        return html('admin/index_login.html.php');
    }
Severity: Minor
Found in controllers/admin.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 Dojo_Delete_end uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        halt('no recaptcha provided');
    }
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 function Save_Xml_data() contains an exit expression.
Open

    $fh = fopen($file, 'w') or die("can't open file");
Severity: Minor
Found in lib/data.model.php by phpmd

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

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

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

    $dojo_name = '';
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

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 {
            return 0;
        }
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 parameters such as '$Dojo'.
Open

function Update_dojo($Dojo)
Severity: Minor
Found in lib/dojo.model.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_false($value, $message = '<1> should be FALSE')
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 env uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

      {
        parse_str(file_get_contents('php://input'), $GLOBALS[$varname]);
      }
Severity: Minor
Found in lib/limonade.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

Severity
Category
Status
Source
Language