public/main/admin/specific_fields.php
Avoid unused parameters such as '$url_params'. Open
Open
function edit_filter($id, $url_params, $row)
- Read upRead up
- Exclude checks
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
Open
function edit_filter($id, $url_params, $row)
- Read upRead up
- Exclude checks
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
Open
global $charset;
- Read upRead up
- Exclude checks
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
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>';
- Read upRead up
- Exclude checks
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
Open
$number_of_extra_fields = count($extra_fields);
- Exclude checks
Variable "column_order" is not in valid camel caps format Open
Open
$column_order
- Exclude checks
Consider putting global function "edit_filter" in a static class Open
Open
function edit_filter($id, $url_params, $row)
- Exclude checks
Variable "column_order" is not in valid camel caps format Open
Open
$column_order = [3, 2, 1];
- Exclude checks
Variable "extra_fields" is not in valid camel caps format Open
Open
$number_of_extra_fields = count($extra_fields);
- Exclude checks
Variable "extra_fields" is not in valid camel caps format Open
Open
$extra_fields,
- Exclude checks
Variable "url_params" is not in valid camel caps format Open
Open
function edit_filter($id, $url_params, $row)
- Exclude checks
Variable "extra_fields" is not in valid camel caps format Open
Open
$extra_fields = get_specific_field_list();
- Exclude checks
Missing function doc comment Open
Open
function edit_filter($id, $url_params, $row)
- Exclude checks
Variable "extra_fields" is not in valid camel caps format Open
Open
if (!empty($extra_fields)) {
- Exclude checks
Variable "column_show" is not in valid camel caps format Open
Open
$column_show,
- Exclude checks
Variable "column_show" is not in valid camel caps format Open
Open
$column_show = [1, 1, 1];
- Exclude checks