Showing 129 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

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

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

        The class Where has 40 non-getter- and setter-methods. Consider refactoring Where to keep number of methods under 25.
        Open

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

        TooManyMethods

        Since: 0.1

        A class with too many 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'.

        The default was changed from 10 to 25 in PHPMD 2.3.

        Example

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

        The class Where has 30 public methods. Consider refactoring Where to keep number of public methods under 10.
        Open

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

        TooManyPublicMethods

        Since: 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'.

        Example

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

        The class Repository has 18 public methods. Consider refactoring Repository to keep number of public methods under 10.
        Open

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

        TooManyPublicMethods

        Since: 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'.

        Example

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

        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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            <?php
            /**
             * Fixin Framework
             *
             * Copyright (c) Attila Jenei
            Severity: Major
            Found in boosts/web.php and 1 other location - About 2 hrs to fix
            boosts/console.php on lines 1..29

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 129.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            <?php
            /**
             * Fixin Framework
             *
             * Copyright (c) Attila Jenei
            Severity: Major
            Found in boosts/console.php and 1 other location - About 2 hrs to fix
            boosts/web.php on lines 1..29

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 129.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Avoid excessively long variable names like $abstractFactoryMappings. Keep variable name length under 20.
            Open

                protected $abstractFactoryMappings = [];
            Severity: Minor
            Found in classes/Resource/ResourceManager.php by phpmd

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

            Source https://phpmd.org/rules/naming.html#longvariable

            Avoid excessively long variable names like $regenerationForwardTime. Keep variable name length under 20.
            Open

                protected $regenerationForwardTime = 1;

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

            Source https://phpmd.org/rules/naming.html#longvariable

            Avoid excessively long variable names like $resourceManagerConfig. Keep variable name length under 20.
            Open

                    $resourceManagerConfig = $config[static::RESOURCE_MANAGER_ROOT];
            Severity: Minor
            Found in classes/Application/Application.php by phpmd

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

            Source https://phpmd.org/rules/naming.html#longvariable

            Avoid excessively long variable names like $lazyLoadingProperties. Keep variable name length under 20.
            Open

                private $lazyLoadingProperties = [];
            Severity: Minor
            Found in classes/Resource/Managed.php by phpmd

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

            Source https://phpmd.org/rules/naming.html#longvariable

            Avoid excessively long variable names like $abstractFactoryDefinitions. Keep variable name length under 20.
            Open

                protected $abstractFactoryDefinitions = [];
            Severity: Minor
            Found in classes/Resource/ResourceManager.php by phpmd

            LongVariable

            Since: 0.2

            Detects when a field, formal or local variable is declared with a long name.

            Example

            class Something {
                protected $reallyLongIntName = -3; // VIOLATION - Field
                public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                    $otherReallyLongName = -5; // VIOLATION - Local
                    for ($interestingIntIndex = 0; // VIOLATION - For
                         $interestingIntIndex < 10;
                         $interestingIntIndex++ ) {
                    }
                }
            }

            Source https://phpmd.org/rules/naming.html#longvariable

            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

            The class Request has 16 fields. Consider redesigning Request to keep the number of fields under 15.
            Open

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

            TooManyFields

            Since: 0.1

            Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

            Example

            class Person {
               protected $one;
               private $two;
               private $three;
               [... many more fields ...]
            }

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

            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

            Severity
            Category
            Status
            Source
            Language