SU-SWS/stanford_person

View on GitHub

Showing 4 of 37 total issues

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

  $requirements['stanford_person_importer_encrypt'] = [

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 '$requirements' which will lead to PHP notices.
Open

  return $requirements;

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 assigning values to variables in if clauses and the like (line '131', column '11').
Open

  protected function getAllowedFields() {
    $allowed_fields = $this->configFactory->getEditable('migrate_plus.migration.su_stanford_person')
      ->getOriginal('source.fields') ?: [];
    foreach ($allowed_fields as &$field) {
      $field = $field['selector'];

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Avoid assigning values to variables in if clauses and the like (line '75', column '9').
Open

function stanford_person_importer_post_update_8002(&$sandbox) {
  if (!\Drupal::database()
    ->schema()
    ->tableExists('migrate_map_su_stanford_person')) {
    return;

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Severity
Category
Status
Source
Language