The class ExternalNotificationConnectPlugin has a coupling between objects value of 22. Consider to reduce the number of dependencies under 13. Open
class ExternalNotificationConnectPlugin extends Plugin implements HookPluginInterface
{
public const SETTING_AUTH_URL = 'auth_url';
public const SETTING_AUTH_USERNAME = 'auth_username';
public const SETTING_AUTH_PASSWORD = 'auth_password';
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Missing class import via use statement (line '230', column '23'). Open
throw new Exception($e->getMessage());
- 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 '236', column '23'). Open
throw new Exception($json['message']);
- 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 '225', column '27'). Open
throw new Exception($e->getMessage());
- 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 performActionsAfterConfigure uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$portfolioItemAddedEvent->detach($portfolioItemAddedObserver);
$portfolioItemEditedEvent->detach($portfolioItemEditedObserver);
$portfolioItemDeletedEvent->detach($portfolioItemDeletedObserver);
$portfolioItemVisibilityEvent->detach($portfolioItemVisibilityObserver);
- 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 performActionsAfterConfigure uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$lpCreatedEvent->detach($lpCreatedObserver);
}
- 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 getAccessToken uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$tks = explode('.', $accessToken->getToken());
$payload = json_decode(JWT::urlsafeB64Decode($tks[1]), true);
- 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
Missing function doc comment Open
public static function create(): ?ExternalNotificationConnectPlugin
- Exclude checks
Missing class doc comment Open
class ExternalNotificationConnectPlugin extends Plugin implements HookPluginInterface
- Exclude checks
Missing function doc comment Open
public function performActionsAfterConfigure(): ExternalNotificationConnectPlugin
- Exclude checks
Missing function doc comment Open
public function installHook()
- Exclude checks
Missing function doc comment Open
public function uninstall()
- Exclude checks
Missing function doc comment Open
public function install()
- Exclude checks
Missing function doc comment Open
public function uninstallHook()
- Exclude checks