chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/zombie/zombie_report.class.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '230', column '22').
Open

        $table = new SortableTable('zombie_users', $count, $data, 1, 50);

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '77', column '21').
Open

        $form = new FormValidator(

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

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

        } else {
            echo $result;
        }

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 display_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            echo $table->return_table();
        }

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 format_active uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $image = StateIcon::INCOMPLETE;
            $text = get_lang('No');
        }

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 parameter $additional_parameters is not named in camelCase.
Open

    public function __construct($additional_parameters = [])
    {
        $this->additional_parameters = $additional_parameters;
    }

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $additional_parameters is not named in camelCase.
Open

    public static function create($additional_parameters = [])
    {
        return new self($additional_parameters);
    }

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The property $additional_parameters is not named in camelCase.
Open

class ZombieReport implements Countable
{
    protected $additional_parameters = [];

    protected $parameters_form = null;

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 $parameters_form is not named in camelCase.
Open

class ZombieReport implements Countable
{
    protected $additional_parameters = [];

    protected $parameters_form = null;

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

Variable "additional_parameters" is not in valid camel caps format
Open

        return new self($additional_parameters);

Method name "ZombieReport::display_parameters" is not in camel caps format
Open

    public function display_parameters($return = false)

Method name "ZombieReport::is_valid" is not in camel caps format
Open

    public function is_valid()

Missing function doc comment
Open

    public function count()

Variable "active_only" is not in valid camel caps format
Open

        $items = ZombieManager::listZombies($ceiling, $active_only, null, null);

Missing function doc comment
Open

    public function display_data($return = false)

Variable "additional_parameters" is not in valid camel caps format
Open

        $this->additional_parameters = $additional_parameters;

Variable "additional_parameters" is not in valid camel caps format
Open

        $parameters = array_merge($additional_parameters, $parameters);

Variable "additional_parameters" is not in valid camel caps format
Open

        $this->additional_parameters = $additional_parameters;

Method name "ZombieReport::get_additional_parameters" is not in camel caps format
Open

    public function get_additional_parameters()

Method name "ZombieReport::get_active_only" is not in camel caps format
Open

    public function get_active_only()

Variable "active_only" is not in valid camel caps format
Open

        $items = ZombieManager::listZombies($ceiling, $active_only, $from, $count, $column, $direction);

Method name "ZombieReport::format_status" is not in camel caps format
Open

    public function format_status($status)

Missing function doc comment
Open

    public function get_parameters()

Missing function doc comment
Open

    public function format_email($email)

Missing function doc comment
Open

    public function display_parameters($return = false)

Method name "ZombieReport::get_ceiling" is not in camel caps format
Open

    public function get_ceiling($format = null)

Method name "ZombieReport::perform_action" is not in camel caps format
Open

    public function perform_action()

Method name "ZombieReport::get_data" is not in camel caps format
Open

    public function get_data($from, $count, $column, $direction)

Missing function doc comment
Open

    public function display($return = false)

Missing function doc comment
Open

    public function get_action()

Method name "ZombieReport::get_action" is not in camel caps format
Open

    public function get_action()

Variable "active_only" is not in valid camel caps format
Open

        $active_only = $this->get_active_only();

Variable "additional_parameters" is not in valid camel caps format
Open

    public function __construct($additional_parameters = [])

Method name "ZombieReport::get_parameters" is not in camel caps format
Open

    public function get_parameters()

Method name "ZombieReport::get_parameters_form" is not in camel caps format
Open

    public function get_parameters_form()

Method name "ZombieReport::display_data" is not in camel caps format
Open

    public function display_data($return = false)

Method name "ZombieReport::format_email" is not in camel caps format
Open

    public function format_email($email)

Missing function doc comment
Open

    public function is_valid()

Variable "active_only" is not in valid camel caps format
Open

        $active_only = $this->get_active_only();

Missing function doc comment
Open

    public function __construct($additional_parameters = [])

Missing function doc comment
Open

    public function get_ceiling($format = null)

Variable "additional_parameters" is not in valid camel caps format
Open

        $additional_parameters = $this->get_additional_parameters();

Variable "additional_parameters" is not in valid camel caps format
Open

        return $this->additional_parameters;

Missing function doc comment
Open

    public function perform_action()

Missing function doc comment
Open

    public function get_active_only()

Missing function doc comment
Open

    public function get_data($from, $count, $column, $direction)

Variable "additional_parameters" is not in valid camel caps format
Open

    public static function create($additional_parameters = [])

Method name "ZombieReport::format_active" is not in camel caps format
Open

    public function format_active($active)

Missing function doc comment
Open

    public function get_additional_parameters()

Missing function doc comment
Open

    public function format_status($status)

The variable $active_only is not named in camelCase.
Open

    public function count()
    {
        $ceiling = $this->get_ceiling();
        $active_only = $this->get_active_only();
        $items = ZombieManager::listZombies($ceiling, $active_only, null, null);

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 $active_only is not named in camelCase.
Open

    public function get_data($from, $count, $column, $direction)
    {
        $ceiling = $this->get_ceiling();
        $active_only = $this->get_active_only();
        $items = ZombieManager::listZombies($ceiling, $active_only, $from, $count, $column, $direction);

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 $additional_parameters is not named in camelCase.
Open

    public static function create($additional_parameters = [])
    {
        return new self($additional_parameters);
    }

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 $additional_parameters is not named in camelCase.
Open

    public function display_data($return = false)
    {
        $count = [$this, 'count'];
        $data = [$this, 'get_data'];

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 $active_only is not named in camelCase.
Open

    public function count()
    {
        $ceiling = $this->get_ceiling();
        $active_only = $this->get_active_only();
        $items = ZombieManager::listZombies($ceiling, $active_only, null, null);

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 $active_only is not named in camelCase.
Open

    public function get_data($from, $count, $column, $direction)
    {
        $ceiling = $this->get_ceiling();
        $active_only = $this->get_active_only();
        $items = ZombieManager::listZombies($ceiling, $active_only, $from, $count, $column, $direction);

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 $additional_parameters is not named in camelCase.
Open

    public function __construct($additional_parameters = [])
    {
        $this->additional_parameters = $additional_parameters;
    }

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 $additional_parameters is not named in camelCase.
Open

    public function display_data($return = false)
    {
        $count = [$this, 'count'];
        $data = [$this, 'get_data'];

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 method get_parameters_form is not named in camelCase.
Open

    public function get_parameters_form()
    {
        $form = new FormValidator(
            'zombie_report_parameters',
            'get',

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 format_email is not named in camelCase.
Open

    public function format_email($email)
    {
        return Display::encrypted_mailto_link($email, $email);
    }

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 get_additional_parameters is not named in camelCase.
Open

    public function get_additional_parameters()
    {
        return $this->additional_parameters;
    }

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 display_data is not named in camelCase.
Open

    public function display_data($return = false)
    {
        $count = [$this, 'count'];
        $data = [$this, 'get_data'];

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 get_action is not named in camelCase.
Open

    public function get_action()
    {
        /**
         * todo check token.
         */

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 format_status is not named in camelCase.
Open

    public function format_status($status)
    {
        $statusname = api_get_status_langvars();

        return $statusname[$status];

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 perform_action is not named in camelCase.
Open

    public function perform_action()
    {
        $ids = Request::post('id');
        if (empty($ids)) {
            return $ids;

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 get_ceiling is not named in camelCase.
Open

    public function get_ceiling($format = null)
    {
        $result = Request::get('ceiling');
        $result = $result ? $result : ZombieManager::last_year();

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 is_valid is not named in camelCase.
Open

    public function is_valid()
    {
        $form = $this->get_parameters_form();

        return false == $form->isSubmitted() || $form->validate();

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 get_data is not named in camelCase.
Open

    public function get_data($from, $count, $column, $direction)
    {
        $ceiling = $this->get_ceiling();
        $active_only = $this->get_active_only();
        $items = ZombieManager::listZombies($ceiling, $active_only, $from, $count, $column, $direction);

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 get_parameters is not named in camelCase.
Open

    public function get_parameters()
    {
        $result = [
            'items' => [
                [

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 display_parameters is not named in camelCase.
Open

    public function display_parameters($return = false)
    {
        $form = $this->get_parameters_form();
        $result = $form->returnForm();

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 format_active is not named in camelCase.
Open

    public function format_active($active)
    {
        $active = '1' == $active;
        if ($active) {
            $image = StateIcon::COMPLETE;

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 get_active_only is not named in camelCase.
Open

    public function get_active_only()
    {
        $result = Request::get('active_only', false);
        $result = 'true' === $result ? true : $result;
        $result = 'false' === $result ? false : $result;

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