SU-SWS/stanford_actions

View on GitHub

Showing 5 of 21 total issues

Avoid using undefined variables such as '$node_ids' which will lead to PHP notices.
Open

      $node_ids[] = $item[0];
Severity: Minor
Found in src/Plugin/Action/CloneNode.php by phpmd

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 using undefined variables such as '$node_ids' which will lead to PHP notices.
Open

      ->loadMultiple($node_ids);
Severity: Minor
Found in src/Plugin/Action/CloneNode.php by phpmd

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

The class CloneNode has a coupling between objects value of 22. Consider to reduce the number of dependencies under 13.
Open

class CloneNode extends ViewsBulkOperationsActionBase implements PluginFormInterface, ContainerFactoryPluginInterface {

  /**
   * {@inheritdoc}
   */
Severity: Minor
Found in src/Plugin/Action/CloneNode.php by phpmd

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

Call with 3 arg(s) to \Drupal\stanford_actions\Plugin\Action\FieldClone\FieldCloneBase::__construct() which only takes 0 arg(s) defined at /code/src/Plugin/Action/FieldClone/FieldCloneBase.php:14
Open

    return new static($configuration, $plugin_id, $plugin_definition);

Instantiation of abstract class \Drupal\stanford_actions\Plugin\Action\FieldClone\FieldCloneBase
Open

    return new static($configuration, $plugin_id, $plugin_definition);
Severity
Category
Status
Source
Language