src/validators/Dependencies.php
Method check
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function check()
{
if(!self::check_critical_dependencies()) {
return false;
}
Method check_critical_dependencies
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function check_critical_dependencies()
{
$critical_dependencies = [
[
'name' => 'PHP',
Avoid using undefined variables such as '$plugin' which will lead to PHP notices. Open
Open
array_push($errors, $plugin);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid unused parameters such as '$name'. Open
Open
public static function critical_dependency_missing_notice($name, $version)
- 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 '$version'. Open
Open
public static function critical_dependency_missing_notice($name, $version)
- 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 '$link'. Open
Open
public static function missing_notice($name, $version, $link)
- 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 '$version'. Open
Open
public static function missing_notice($name, $version, $link)
- 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 '$plugin'. Open
Open
array_push($errors, $plugin);
- 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
Avoid unused parameters such as '$name'. Open
Open
public static function missing_notice($name, $version, $link)
- 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
The property $active_plugins is not named in camelCase. Open
Open
class VindiDependencies
{
/**
* @var array
*/
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 9 and the first side effect is on line 6. Open
Open
<?php
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(!self::check_critical_dependencies()) {
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(!empty($errors)) {
- Exclude checks