efureev/u.php

View on GitHub

Showing 114 of 114 total issues

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

    public static function sanitizeString($string, $alpha = true, $strip = true)
Severity: Minor
Found in src/uString.php by phpmd

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

Missing class import via use statement (line '43', column '27').
Open

                throw new \Exception(
Severity: Minor
Found in src/uSecurity.php by phpmd

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 '109', column '19').
Open

        throw new \Exception('Unable to generate a random key');
Severity: Minor
Found in src/uSecurity.php by phpmd

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

Avoid too many return statements within this method.
Open

            return false;
Severity: Major
Found in src/uArray.php - About 30 mins to fix

    Missing class import via use statement (line '250', column '59').
    Open

            $dirIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir, $flags));
    Severity: Minor
    Found in src/uFile.php by phpmd

    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

    Avoid too many return statements within this method.
    Open

            return ($parseInfo['completed'] && ($parseInfo['isExists'] || $parseInfo['isString'])) ? $parseInfo['value'] : $default;
    Severity: Major
    Found in src/uArray.php - About 30 mins to fix

      Missing class import via use statement (line '96', column '23').
      Open

                  throw new \Exception('File missing: ' . $file);
      Severity: Minor
      Found in src/uFile.php by phpmd

      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 get has a boolean flag argument $ignoreString, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function get($key, array $array, $default = null, $ignoreString = true)
      Severity: Minor
      Found in src/uArray.php by phpmd

      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

      Missing class import via use statement (line '229', column '24').
      Open

              $dirIter = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir, $flags));
      Severity: Minor
      Found in src/uFile.php by phpmd

      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 '250', column '28').
      Open

              $dirIterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir, $flags));
      Severity: Minor
      Found in src/uFile.php by phpmd

      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 '16', column '23').
      Open

                  throw new \Exception('First parameter ($length) must be an integer');
      Severity: Minor
      Found in src/uSecurity.php by phpmd

      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 contains has a boolean flag argument $caseSensitive, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function contains($string, $subStr, $caseSensitive = true)
      Severity: Minor
      Found in src/uString.php by phpmd

      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

      Avoid too many return statements within this method.
      Open

                  return number_format($bytes / pow(1024, 5), $decimals, '.', '') . ' PiB';
      Severity: Major
      Found in src/uFile.php - About 30 mins to fix

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

            public static function hex2RGB($hexStr, $returnAsString = false, $separator = ',')
        Severity: Minor
        Found in src/uColor.php by phpmd

        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 save has a boolean flag argument $replace, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function save($key, array &$array, $value, $replace = true)
        Severity: Minor
        Found in src/uArray.php by phpmd

        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

        Missing class import via use statement (line '124', column '23').
        Open

                    throw new \Exception('First parameter ($length) must be an integer');
        Severity: Minor
        Found in src/uSecurity.php by phpmd

        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 size has a boolean flag argument $format, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function size($file, $format = true)
        Severity: Minor
        Found in src/uFile.php by phpmd

        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 sanitizeString has a boolean flag argument $alpha, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function sanitizeString($string, $alpha = true, $strip = true)
        Severity: Minor
        Found in src/uString.php by phpmd

        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

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

                            $mCurSource[ $key ] = [];
        Severity: Minor
        Found in src/uArray.php by phpmd

        UnusedLocalVariable

        Since: 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 https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

        Avoid using static access to class 'efureev\uString' in method 'generateRandomKey'.
        Open

                    if ($key !== false && uString::byteLength($key) === $length) {
        Severity: Minor
        Found in src/uSecurity.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Severity
        Category
        Status
        Source
        Language