Missing class import via use statement (line '230', column '22'). Open
$table = new SortableTable('zombie_users', $count, $data, 1, 50);
- Read upRead up
- Exclude checks
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(
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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();
}
- Read upRead up
- Exclude checks
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');
}
- Read upRead up
- Exclude checks
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;
}
- 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
The parameter $additional_parameters is not named in camelCase. Open
public static function create($additional_parameters = [])
{
return new self($additional_parameters);
}
- 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
The property $additional_parameters is not named in camelCase. Open
class ZombieReport implements Countable
{
protected $additional_parameters = [];
protected $parameters_form = null;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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);
- Exclude checks
Method name "ZombieReport::display_parameters" is not in camel caps format Open
public function display_parameters($return = false)
- Exclude checks
Method name "ZombieReport::is_valid" is not in camel caps format Open
public function is_valid()
- Exclude checks
Missing function doc comment Open
public function count()
- Exclude checks
Variable "active_only" is not in valid camel caps format Open
$items = ZombieManager::listZombies($ceiling, $active_only, null, null);
- Exclude checks
Missing function doc comment Open
public function display_data($return = false)
- Exclude checks
Variable "additional_parameters" is not in valid camel caps format Open
$this->additional_parameters = $additional_parameters;
- Exclude checks
Variable "additional_parameters" is not in valid camel caps format Open
$parameters = array_merge($additional_parameters, $parameters);
- Exclude checks
Variable "additional_parameters" is not in valid camel caps format Open
$this->additional_parameters = $additional_parameters;
- Exclude checks
Method name "ZombieReport::get_additional_parameters" is not in camel caps format Open
public function get_additional_parameters()
- Exclude checks
Method name "ZombieReport::get_active_only" is not in camel caps format Open
public function get_active_only()
- Exclude checks
Variable "active_only" is not in valid camel caps format Open
$items = ZombieManager::listZombies($ceiling, $active_only, $from, $count, $column, $direction);
- Exclude checks
Method name "ZombieReport::format_status" is not in camel caps format Open
public function format_status($status)
- Exclude checks
Missing function doc comment Open
public function get_parameters()
- Exclude checks
Missing function doc comment Open
public function format_email($email)
- Exclude checks
Missing function doc comment Open
public function display_parameters($return = false)
- Exclude checks
Method name "ZombieReport::get_ceiling" is not in camel caps format Open
public function get_ceiling($format = null)
- Exclude checks
Method name "ZombieReport::perform_action" is not in camel caps format Open
public function perform_action()
- Exclude checks
Method name "ZombieReport::get_data" is not in camel caps format Open
public function get_data($from, $count, $column, $direction)
- Exclude checks
Missing function doc comment Open
public function display($return = false)
- Exclude checks
Missing function doc comment Open
public function get_action()
- Exclude checks
Method name "ZombieReport::get_action" is not in camel caps format Open
public function get_action()
- Exclude checks
Variable "active_only" is not in valid camel caps format Open
$active_only = $this->get_active_only();
- Exclude checks
Variable "additional_parameters" is not in valid camel caps format Open
public function __construct($additional_parameters = [])
- Exclude checks
Method name "ZombieReport::get_parameters" is not in camel caps format Open
public function get_parameters()
- Exclude checks
Method name "ZombieReport::get_parameters_form" is not in camel caps format Open
public function get_parameters_form()
- Exclude checks
Method name "ZombieReport::display_data" is not in camel caps format Open
public function display_data($return = false)
- Exclude checks
Method name "ZombieReport::format_email" is not in camel caps format Open
public function format_email($email)
- Exclude checks
Missing function doc comment Open
public function is_valid()
- Exclude checks
Variable "active_only" is not in valid camel caps format Open
$active_only = $this->get_active_only();
- Exclude checks
Missing function doc comment Open
public function __construct($additional_parameters = [])
- Exclude checks
Missing function doc comment Open
public function get_ceiling($format = null)
- Exclude checks
Variable "additional_parameters" is not in valid camel caps format Open
$additional_parameters = $this->get_additional_parameters();
- Exclude checks
Variable "additional_parameters" is not in valid camel caps format Open
return $this->additional_parameters;
- Exclude checks
Missing function doc comment Open
public function perform_action()
- Exclude checks
Missing function doc comment Open
public function get_active_only()
- Exclude checks
Missing function doc comment Open
public function get_data($from, $count, $column, $direction)
- Exclude checks
Variable "additional_parameters" is not in valid camel caps format Open
public static function create($additional_parameters = [])
- Exclude checks
Method name "ZombieReport::format_active" is not in camel caps format Open
public function format_active($active)
- Exclude checks
Missing function doc comment Open
public function get_additional_parameters()
- Exclude checks
Missing function doc comment Open
public function format_status($status)
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
}
- Read upRead up
- Exclude checks
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'];
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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'];
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
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);
}
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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'];
- Read upRead up
- Exclude checks
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.
*/
- Read upRead up
- Exclude checks
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];
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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' => [
[
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
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;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}