Showing 120 of 120 total issues

Method mapPreload has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function mapPreload($side, $preloadProperty, $reusableResult, $plan, $relatedLoader)
    {
        $config = $side->config();

        $itemRepository = $this->getRepository($config->itemModel);
Severity: Minor
Found in src/PHPixie/ORM/Relationships/Type/OneTo/Handler.php - About 1 hr to fix

    Method link has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function link($pivot, $firstSide, $secondSide, $plan)
        {
            $pivotTable = $pivot->source();
    
            $sides = array(
    Severity: Minor
    Found in src/PHPixie/ORM/Planners/Planner/Pivot/Strategy/SQL.php - About 1 hr to fix

      Method execute has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function execute()
          {
              $fields = array(
                  $leftKey = $this->config->leftKey,
                  $rightKey = $this->config->rightKey,

        Method mapPreload has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function mapPreload($side, $preloadProperty, $result, $plan, $relatedLoader)
            {
        
                $dependencies   = $this->getMappingDependencies($side);
                $config         = $dependencies['config'];
        Severity: Minor
        Found in src/PHPixie/ORM/Relationships/Type/ManyToMany/Handler.php - About 1 hr to fix

          Method extractCollections has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function extractCollections($conditions, $parseLogic = false)
              {
                  $extracted = array();
                  $count = count($conditions);
                  foreach($conditions as $key => $condition) {
          Severity: Minor
          Found in src/PHPixie/ORM/Mappers/Conditions/Optimizer.php - About 1 hr to fix

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

                protected function mapConditionBuilder($builder, $side, $collection, $plan)
                {
                    $config = $side->config();
                    $builder->startConditionGroup($collection->logic(), $collection->isNegated());
                        
            src/PHPixie/ORM/Relationships/Type/Embeds/Type/Many/Handler.php on lines 7..23

            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 114.

            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

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

                    usort($data, function($a, $b) use($leftKey, $rootIdKey) {
                        if($a[$rootIdKey] == $b[$rootIdKey]) {
                            if($a[$leftKey] == $b[$leftKey]) {
                                return 0;
                            }
            src/PHPixie/ORM/Relationships/Type/NestedSet/Preloader.php on lines 98..108

            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 114.

            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

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

                    usort($data, function($a, $b) use($leftKey, $rootIdKey) {
                        if($a[$rootIdKey] == $b[$rootIdKey]) {
                            if($a[$leftKey] == $b[$leftKey]) {
                                return 0;
                            }
            Severity: Major
            Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Preloader.php and 1 other location - About 1 hr to fix
            src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/RemoveNodes.php on lines 33..43

            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 114.

            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

                protected function mapConditionBuilder($builder, $side, $collection, $plan)
                {
                    $config = $side->config();
                    $builder->startConditionGroup($collection->logic(), $collection->isNegated());
                        
            src/PHPixie/ORM/Relationships/Type/Embeds/Type/One/Handler.php on lines 7..23

            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 114.

            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

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

                public function execute()
                {
                    $modelConfig = $this->repository->config();
                    $config = $this->config;
            
            
            Severity: Minor
            Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/RemoveNodes.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 loadProperty has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function loadProperty($property)
                {
                    $this->ensureMapped();
                    $entity = $property->entity();
                    $type = $property->side()->type();
            Severity: Minor
            Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Preloader.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 execute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function execute()
                {
                    $fields = array(
                        $leftKey = $this->config->leftKey,
                        $rightKey = $this->config->rightKey,

            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 mapDatabaseQuery has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function mapDatabaseQuery($builder, $side, $group, $plan)
                {
                    $config = $side->config();
                    $repository = $this->repository($config);
            
            
            Severity: Minor
            Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Handler.php - About 1 hr to fix

              Function mapTree has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function mapTree($data)
                  {
                      $sideConfig = $this->side->config();
              
                      $idField  = $this->modelConfig->idField;
              Severity: Minor
              Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Preloader.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 findMergeTarget has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function findMergeTarget($conditionList, $newCondition)
                  {
                      $isNextFree = true;
                      $newPrecedance = $this->logicPrecedance[$newCondition->logic()];
                      
              Severity: Minor
              Found in src/PHPixie/ORM/Mappers/Conditions/Optimizer.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 normalizeIn has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function normalizeIn($inCondition)
                  {
                      $modelName = $inCondition->modelName();
                      $items  = $inCondition->items();
                      $idField = $this->models->database()->config($modelName)->idField;
              Severity: Minor
              Found in src/PHPixie/ORM/Mappers/Conditions/Normalizer.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 normalizeIn has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function normalizeIn($inCondition)
                  {
                      $modelName = $inCondition->modelName();
                      $items  = $inCondition->items();
                      $idField = $this->models->database()->config($modelName)->idField;
              Severity: Minor
              Found in src/PHPixie/ORM/Mappers/Conditions/Normalizer.php - About 1 hr to fix

                Method mapPreload has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function mapPreload($side, $property, $result, $plan, $relatedLoader)
                    {
                        $config = $side->config();
                        $repository = $this->repository($config);
                
                
                Severity: Minor
                Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Handler.php - About 1 hr to fix

                  Method execute has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function execute()
                      {
                          $fields = array(
                              $rootIdKey = $this->config->rootIdKey,
                              $leftKey = $this->config->leftKey,
                  Severity: Minor
                  Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/MapQuery.php - About 1 hr to fix

                    Method mapItems has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function mapItems()
                        {
                            $sideConfig = $this->side->config();
                    
                            $fields = array(
                    Severity: Minor
                    Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Preloader.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language