lib/Ajde/Crud/Options.php

Summary

Maintainability
A
0 mins
Test Coverage

The method Ajde_Crud_Options::display() calls the typical debug function var_dump() which is mostly only used during development.
Open

        var_dump($this->_stack);
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

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

The method up has a boolean flag argument $obj, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function up($obj = false)
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

Avoid using short method names like Ajde_Crud_Options::up(). The configured minimum method name length is 3.
Open

    public function up($obj = false)
    {
        if (!$obj) {
            $obj = $this;
        }
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

ShortMethodName

Since: 0.2

Detects when very short method names are used.

Example

class ShortMethod {
    public function a( $index ) { // Violation
    }
}

Source https://phpmd.org/rules/naming.html#shortmethodname

The property $_parent is not named in camelCase.
Open

class Ajde_Crud_Options extends Ajde_Object_Standard
{
    protected $_key;

    /**
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The class Ajde_Crud_Options is not named in CamelCase.
Open

class Ajde_Crud_Options extends Ajde_Object_Standard
{
    protected $_key;

    /**
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $_key is not named in camelCase.
Open

class Ajde_Crud_Options extends Ajde_Object_Standard
{
    protected $_key;

    /**
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $_stack is not named in camelCase.
Open

class Ajde_Crud_Options extends Ajde_Object_Standard
{
    protected $_key;

    /**
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The method _select is not named in camelCase.
Open

    protected function _select($name, $key = null)
    {
        $key = isset($key) ? $key : $name;
        // Get new active object
        $className = get_class($this).'_'.ucfirst($name);
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method _set is not named in camelCase.
Open

    protected function _set($key, $value)
    {
        parent::_set($key, $value);

        return $this;
Severity: Minor
Found in lib/Ajde/Crud/Options.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status