yiisoft/yii2

View on GitHub
framework/helpers/BaseArrayHelper.php

Summary

Maintainability
F
3 days
Test Coverage

Function toArray has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public static function toArray($object, $properties = [], $recursive = true)
    {
        if (is_array($object)) {
            if ($recursive) {
                foreach ($object as $key => $value) {
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function filter has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public static function filter($array, $filters)
    {
        $result = [];
        $excludeFilters = [];

Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

The class BaseArrayHelper has an overall complexity of 135 which is very high. The configured complexity threshold is 50.
Open

class BaseArrayHelper
{
    /**
     * Converts an object or an array of objects into an array.
     * @param object|array|string $object the object to be converted into an array
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php by phpmd

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

class Foo {
      public function bar() {
          if ($a == $b)  {
              if ($a1 == $b1) {
                  fiddle();
              } elseif ($a2 == $b2) {
                  fiddle();
              } else {
              }
          }
      }
      public function baz() {
          if ($a == $b) {
              if ($a1 == $b1) {
                  fiddle();
              } elseif ($a2 == $b2) {
                  fiddle();
              } else {
              }
          }
      }
      // Several other complex methods
  }

Source: http://phpmd.org/rules/codesize.txt

The class BaseArrayHelper has 16 public methods. Consider refactoring BaseArrayHelper to keep number of public methods under 10.
Open

class BaseArrayHelper
{
    /**
     * Converts an object or an array of objects into an array.
     * @param object|array|string $object the object to be converted into an array
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php by phpmd

Since: PHPMD 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects. By default it ignores methods starting with 'get' or 'set'.

Source: http://phpmd.org/rules/codesize.txt

Function index has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public static function index($array, $key, $groups = [])
    {
        $result = [];
        $groups = (array) $groups;

Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function merge has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function merge($a, $b)
    {
        $args = func_get_args();
        $res = array_shift($args);
        while (!empty($args)) {
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getValue($array, $key, $default = null)
    {
        if ($key instanceof \Closure) {
            return $key($array, $default);
        }
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function isAssociative has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isAssociative($array, $allStrings = true)
    {
        if (!is_array($array) || empty($array)) {
            return false;
        }
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function keyExists has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function keyExists($key, $array, $caseSensitive = true)
    {
        if ($caseSensitive) {
            // Function `isset` checks key faster but skips `null`, `array_key_exists` handles this case
            // https://secure.php.net/manual/en/function.array-key-exists.php#107786
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function isIn has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isIn($needle, $haystack, $strict = false)
    {
        if ($haystack instanceof Traversable) {
            foreach ($haystack as $value) {
                if ($needle == $value && (!$strict || $needle === $value)) {
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function htmlEncode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function htmlEncode($data, $valuesOnly = true, $charset = null)
    {
        if ($charset === null) {
            $charset = Yii::$app ? Yii::$app->charset : 'UTF-8';
        }
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function htmlDecode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function htmlDecode($data, $valuesOnly = true)
    {
        $d = [];
        foreach ($data as $key => $value) {
            if (!$valuesOnly && is_string($key)) {
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function multisort has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function multisort(&$array, $key, $direction = SORT_ASC, $sortFlag = SORT_REGULAR)
    {
        $keys = is_array($key) ? $key : [$key];
        if (empty($keys) || empty($array)) {
            return;
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function isSubset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isSubset($needles, $haystack, $strict = false)
    {
        if (is_array($needles) || $needles instanceof Traversable) {
            foreach ($needles as $needle) {
                if (!static::isIn($needle, $haystack, $strict)) {
Severity: Minor
Found in framework/helpers/BaseArrayHelper.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid too many return statements within this method.
Open

        return false;
Severity: Major
Found in framework/helpers/BaseArrayHelper.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                        return $default;
    Severity: Major
    Found in framework/helpers/BaseArrayHelper.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $default;
      Severity: Major
      Found in framework/helpers/BaseArrayHelper.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return true;
        Severity: Major
        Found in framework/helpers/BaseArrayHelper.php - About 30 mins to fix

          Function setValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function setValue(&$array, $path, $value)
              {
                  if ($path === null) {
                      $array = $value;
                      return;
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function getColumn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getColumn($array, $name, $keepKeys = true)
              {
                  $result = [];
                  if ($keepKeys) {
                      foreach ($array as $k => $element) {
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function isIndexed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function isIndexed($array, $consecutive = false)
              {
                  if (!is_array($array)) {
                      return false;
                  }
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function removeValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function removeValue(&$array, $value)
              {
                  $result = [];
                  if (is_array($array)) {
                      foreach ($array as $key => $val) {
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          The method filter() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
          Open

              public static function filter($array, $filters)
              {
                  $result = [];
                  $excludeFilters = [];
          
          
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example:

          // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

          Source: http://phpmd.org/rules/codesize.txt

          The method toArray() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
          Open

              public static function toArray($object, $properties = [], $recursive = true)
              {
                  if (is_array($object)) {
                      if ($recursive) {
                          foreach ($object as $key => $value) {
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example:

          // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

          Source: http://phpmd.org/rules/codesize.txt

          The method merge() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
          Open

              public static function merge($a, $b)
              {
                  $args = func_get_args();
                  $res = array_shift($args);
                  while (!empty($args)) {
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example:

          // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

          Source: http://phpmd.org/rules/codesize.txt

          The method getValue() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
          Open

              public static function getValue($array, $key, $default = null)
              {
                  if ($key instanceof \Closure) {
                      return $key($array, $default);
                  }
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example:

          // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

          Source: http://phpmd.org/rules/codesize.txt

          The method htmlDecode has a boolean flag argument $valuesOnly, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function htmlDecode($data, $valuesOnly = true)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method toArray has a boolean flag argument $recursive, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function toArray($object, $properties = [], $recursive = true)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method getColumn has a boolean flag argument $keepKeys, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function getColumn($array, $name, $keepKeys = true)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method isIndexed has a boolean flag argument $consecutive, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function isIndexed($array, $consecutive = false)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method isAssociative has a boolean flag argument $allStrings, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function isAssociative($array, $allStrings = true)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method isIn has a boolean flag argument $strict, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function isIn($needle, $haystack, $strict = false)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method isSubset has a boolean flag argument $strict, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function isSubset($needles, $haystack, $strict = false)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method htmlEncode has a boolean flag argument $valuesOnly, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function htmlEncode($data, $valuesOnly = true, $charset = null)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          The method keyExists has a boolean flag argument $caseSensitive, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function keyExists($key, $array, $caseSensitive = true)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/cleancode.txt

          Avoid unused parameters such as '$a'.
          Open

              public static function merge($a, $b)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/unusedcode.txt

          Avoid unused local variables such as '$value'.
          Open

                  foreach ($array as $key => $value) {
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/unusedcode.txt

          Avoid unused parameters such as '$b'.
          Open

              public static function merge($a, $b)
          Severity: Minor
          Found in framework/helpers/BaseArrayHelper.php by phpmd

          Since: PHPMD 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: http://phpmd.org/rules/unusedcode.txt

          There are no issues that match your filters.

          Category
          Status