chamilo/chamilo-lms

View on GitHub
public/main/admin/specific_fields.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$url_params'.
Open

function edit_filter($id, $url_params, $row)
Severity: Minor
Found in public/main/admin/specific_fields.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 '$id'.
Open

function edit_filter($id, $url_params, $row)
Severity: Minor
Found in public/main/admin/specific_fields.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 '$charset'.
Open

    global $charset;
Severity: Minor
Found in public/main/admin/specific_fields.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 parameter $url_params is not named in camelCase.
Open

function edit_filter($id, $url_params, $row)
{
    global $charset;
    $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.
        Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
Severity: Minor
Found in public/main/admin/specific_fields.php by phpmd

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

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

$number_of_extra_fields = count($extra_fields);

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

    $column_order

Consider putting global function "edit_filter" in a static class
Open

function edit_filter($id, $url_params, $row)

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

$column_order = [3, 2, 1];

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

$number_of_extra_fields = count($extra_fields);

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

    $extra_fields,

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

function edit_filter($id, $url_params, $row)

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

$extra_fields = get_specific_field_list();

Missing function doc comment
Open

function edit_filter($id, $url_params, $row)

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

if (!empty($extra_fields)) {

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

    $column_show,

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

$column_show = [1, 1, 1];

There are no issues that match your filters.

Category
Status