Showing 44 of 129 total issues

Request has 56 functions (exceeds 20 allowed). Consider refactoring.
Open

class Request extends Prototype implements RequestInterface
{
    use DebugDescriptionTrait;

    protected const
Severity: Major
Found in classes/Model/Request/Request.php - About 1 day to fix

    Where has 41 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Where extends Prototype implements WhereInterface
    {
        use DebugDescriptionTrait;
    
        protected const
    Severity: Minor
    Found in classes/Model/Request/Where/Where.php - About 5 hrs to fix

      Function configureWithOptions has a Cognitive Complexity of 30 (exceeds 5 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 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

      Repository has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Repository extends Resource implements RepositoryInterface
      {
          protected const
              ENTITY_ID_PROTOTYPE = '*\Model\Entity\EntityId',
              ENTITY_REFRESH_FAILURE_EXCEPTION = 'Entity refresh error',
      Severity: Minor
      Found in classes/Model/Repository/Repository.php - About 3 hrs to fix

        File Request.php has 305 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Fixin Framework
         *
         * Copyright (c) Attila Jenei
        Severity: Minor
        Found in classes/Model/Request/Request.php - About 3 hrs to fix

          File Where.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Fixin Framework
           *
           * Copyright (c) Attila Jenei
          Severity: Minor
          Found in classes/Model/Request/Where/Where.php - About 2 hrs to fix

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

                protected function produceResource(string $key, array $options, string $name)
                {
                    if (isset($this->definitions[$key])) {
                        $definition = $this->definitions[$key];
            
            
            Severity: Minor
            Found in classes/Resource/ResourceManager.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 autoloadCallback has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function autoloadCallback(string $class): void
                {
                    // Swap '\'
                    $class = strtr($class, '\\', DIRECTORY_SEPARATOR);
            
            
            Severity: Minor
            Found in classes/Base/Autoloader/SimpleAutoloader.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 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

              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

                  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

                    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 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 compare has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function compare($left, string $operator, $right, string $leftType = self::TYPE_IDENTIFIER, string $rightType = self::TYPE_VALUE): WhereInterface;
                        Severity: Minor
                        Found in classes/Model/Request/Where/WhereInterface.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

                            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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language