Showing 129 of 129 total issues

Method configureWithOptions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function configureWithOptions(array $options): self
    {
        foreach ($options as $name => $value) {
            if (isset(static::THIS_SETS[$name])) {
                $types = (array) static::THIS_SETS[$name];
Severity: Minor
Found in classes/Resource/Managed.php - About 1 hr to fix

    The class Request has 52 public methods and attributes. Consider reducing the number of public items to less than 45.
    Open

    class Request extends Prototype implements RequestInterface
    {
        use DebugDescriptionTrait;
    
        protected const
    Severity: Minor
    Found in classes/Model/Request/Request.php by phpmd

    ExcessivePublicCount

    Since: 0.1

    A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

    Example

    public class Foo {
        public $value;
        public $something;
        public $var;
        // [... more more public attributes ...]
    
        public function doWork() {}
        public function doMoreWork() {}
        public function doWorkAgain() {}
        // [... more more public methods ...]
    }

    Source https://phpmd.org/rules/codesize.html#excessivepubliccount

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

        protected function getContentOptions(ResourceManagerInterface $resourceManager, string $contentType): array
        {
            $contentType = strstr($contentType, ';', true);
    
            if (in_array($contentType, static::FORM_MIME_TYPES)) {
    Severity: Minor
    Found in classes/Delivery/Cargo/Factory/HttpCargoFactory.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

    Method produce has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function produce(string $key, array $options, string $name)
        {
            // CamelCase tags
            $length = strlen($key);
            $index = $this->keyPrefixLength;
    Severity: Minor
    Found in classes/Resource/AbstractFactory/RepositoryFactory.php - About 1 hr to fix

      Method addCompare has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          protected function addCompare(string $join, bool $positive, $left, string $operator, $right, string $leftType, string $rightType): void
      Severity: Major
      Found in classes/Model/Request/Where/Where.php - About 50 mins to fix

        The property $__config is not named in camelCase.
        Open

        class ConfigValues extends AbstractHelper
        {
            /**
             * @var ContainerInterface
             */
        Severity: Minor
        Found in classes/View/Helper/ConfigValues.php by phpmd

        CamelCasePropertyName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name attributes.

        Example

        class ClassName {
            protected $property_name;
        }

        Source

        The parameter $__filename is not named in camelCase.
        Open

            public static function include(AssistantInterface $_, string $__filename, array $__data): void
            {
                // Extract data
                extract($__data, EXTR_SKIP);
                unset($__data);

        CamelCaseParameterName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name parameters.

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        The parameter $__data is not named in camelCase.
        Open

            public static function include(AssistantInterface $_, string $__filename, array $__data): void
            {
                // Extract data
                extract($__data, EXTR_SKIP);
                unset($__data);

        CamelCaseParameterName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name parameters.

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        The parameter $_ is not named in camelCase.
        Open

            public static function include(AssistantInterface $_, string $__filename, array $__data): void
            {
                // Extract data
                extract($__data, EXTR_SKIP);
                unset($__data);

        CamelCaseParameterName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name parameters.

        Example

        class ClassName {
            public function doSomething($user_name) {
            }
        }

        Source

        Method addRouteParameterSegment has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected function addRouteParameterSegment(string $name, array $segments, array $path, string $uri, array $parameters, int $level): void
        Severity: Minor
        Found in classes/Delivery/Node/Factory/HttpRouterHubFactory.php - About 45 mins to fix

          Method processFiles has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected function processFiles(ResourceManagerInterface $resourceManager, $name, $type, $tempFilename, $error, $size): ?array
          Severity: Minor
          Found in classes/Delivery/Cargo/Factory/HttpCargoFactory.php - About 45 mins to fix

            Method addJoin has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                protected function addJoin(string $type, RepositoryInterface $repository, string $left, string $operator, $right, string $alias = null): void
            Severity: Minor
            Found in classes/Model/Request/Request.php - About 45 mins to fix

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

              class Stream implements StreamInterface
              {
                  protected const
                      INVALID_STREAM_EXCEPTION = 'Invalid stream',
                      INVALID_STREAM_REFERENCE_EXCEPTION = 'Invalid stream reference',
              Severity: Minor
              Found in classes/Base/Stream/Stream.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

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

              abstract class AbstractGrammar extends Resource implements GrammarInterface
              {
                  protected const
                      ALIAS_MASK = '%s AS %s',
                      ARRAY_MASK = '(%s)',

              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

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

              class Repository extends Resource implements RepositoryInterface
              {
                  protected const
                      ENTITY_ID_PROTOTYPE = '*\Model\Entity\EntityId',
                      ENTITY_REFRESH_FAILURE_EXCEPTION = 'Entity refresh error',

              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

              Method leftJoin has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function leftJoin(RepositoryInterface $repository, string $left, string $operator, $right, string $alias = null): RequestInterface
              Severity: Minor
              Found in classes/Model/Request/Request.php - About 35 mins to fix

                Method join has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function join(RepositoryInterface $repository, string $left, string $operator, $right, string $alias = null): RequestInterface;
                Severity: Minor
                Found in classes/Model/Request/RequestInterface.php - About 35 mins to fix

                  Method leftJoin has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function leftJoin(RepositoryInterface $repository, string $left, string $operator, $right, string $alias = null): RequestInterface;
                  Severity: Minor
                  Found in classes/Model/Request/RequestInterface.php - About 35 mins to fix

                    Method orCompare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function orCompare($left, string $operator, $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE): WhereInterface
                    Severity: Minor
                    Found in classes/Model/Request/Where/Where.php - About 35 mins to fix

                      Method addRouteSegments has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          protected function addRouteSegments(array $segments, array $path, string $uri, array $parameters, int $level): void
                      Severity: Minor
                      Found in classes/Delivery/Node/Factory/HttpRouterHubFactory.php - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language