Showing 5 of 5 total issues
Avoid excessively long variable names like $network_active_plugins. Keep variable name length under 20. Open
Open
$network_active_plugins = wp_get_active_network_plugins();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Method load_plugin_instance
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function load_plugin_instance( string $main_file, string $class_name ) : Plugin {
if ( ! class_exists( $class_name ) ) {
throw new Plugin_Loading_Exception(
sprintf(
'Plugin class %s does not exist.',
The method install has a boolean flag argument $network_wide, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function install( bool $network_wide = false );
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method deactivate has a boolean flag argument $network_wide, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function deactivate( bool $network_wide = false );
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method activate has a boolean flag argument $network_wide, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function activate( bool $network_wide = false );
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}