gdbots/pbjc-php

View on GitHub

Showing 579 of 579 total issues

Avoid too many return statements within this method.
Open

                return bindec($value);
Severity: Major
Found in src/Util/XmlUtils.php - About 30 mins to fix

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

                    throw new \InvalidArgumentException('The schemaOrCallable argument has to be a valid path to XSD file or callable.');
    Severity: Minor
    Found in src/Util/XmlUtils.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/Util/XmlUtils.php - About 30 mins to fix

      Remove error control operator '@' on line 33.
      Open

          public static function loadFile($file, $schemaOrCallable = null)
          {
              $content = @file_get_contents($file);
              if ('' === trim($content)) {
                  throw new \InvalidArgumentException(sprintf('File %s does not contain valid XML, it is empty.', $file));
      Severity: Minor
      Found in src/Util/XmlUtils.php by phpmd

      ErrorControlOperator

      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

      Example

      function foo($filePath) {
          $file = @fopen($filPath); // hides exceptions
          $key = @$array[$notExistingKey]; // assigns null to $key
      }

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

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

                          throw new \RuntimeException(sprintf('Invalid FieldDescriptor attribute "%s"', $this->attribute));

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

          public static function convertDomElementToArray(\DomElement $element, $checkPrefix = true)
      Severity: Minor
      Found in src/Util/XmlUtils.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 '32', column '27').
      Open

                      throw new \RuntimeException(sprintf('Invalid dependency version "%s"', $a->getId()->toString()));

      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 '161', column '39').
      Open

                                  throw new \RuntimeException(sprintf('%s. See inherited mixin fields.', $error));

      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 '42', column '20').
      Open

              $dom = new \DOMDocument();
      Severity: Minor
      Found in src/Util/XmlUtils.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 '26', column '23').
      Open

                  throw new \RuntimeException(sprintf(
      Severity: Minor
      Found in src/EnumParser.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 schemaToClassName has a boolean flag argument $withMajor, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function schemaToClassName(SchemaDescriptor $schema, $withMajor = false)
      Severity: Minor
      Found in src/Generator/Generator.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 '69', column '31').
      Open

                          throw new \RuntimeException(sprintf(
      Severity: Minor
      Found in src/EnumParser.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 __construct has a boolean flag argument $deprecated, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function __construct($id, $type, array $values, LanguageBag $languages = null, $deprecated = false)
      Severity: Minor
      Found in src/EnumDescriptor.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 '194', column '23').
      Open

                  throw new \InvalidArgumentException(
      Severity: Minor
      Found in src/FieldDescriptor.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 '136', column '23').
      Open

                  throw new \InvalidArgumentException('Missing "namespaces" options.');
      Severity: Minor
      Found in src/Compiler.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 '103', column '23').
      Open

                  throw new \InvalidArgumentException(
      Severity: Minor
      Found in src/FieldDescriptor.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 '44', column '23').
      Open

                  throw new \RuntimeException(sprintf(
      Severity: Minor
      Found in src/EnumParser.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 '97', column '31').
      Open

                          throw new \RuntimeException(sprintf('Recursively requesting schema id "%s" from file "%s".', $e->getMessage(), $currentFile));
      Severity: Minor
      Found in src/Compiler.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 '145', column '27').
      Open

                      throw new \InvalidArgumentException(sprintf(
      Severity: Minor
      Found in src/Compiler.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 '93', column '31').
      Open

                          throw new \RuntimeException(sprintf('Schema with id "%s" is invalid.', $e->getMessage()));
      Severity: Minor
      Found in src/Compiler.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

      Severity
      Category
      Status
      Source
      Language