neos/neos-development-collection

View on GitHub
Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php

Summary

Maintainability
F
1 wk
Test Coverage

File NodeDataRepository.php has 953 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace Neos\ContentRepository\Domain\Repository;

/*
 * This file is part of the Neos.ContentRepository package.

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

    class NodeDataRepository extends Repository
    {
        /**
         * Constants for setNewIndex()
         */

      Function findByParentAndNodeType has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          public function findByParentAndNodeType($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions = null, $removedNodes = false, $recursive = false)
          {
              $parentPath = strtolower($parentPath);
              $foundNodes = $this->getNodeDataForParentAndNodeType($parentPath, $nodeTypeFilter, $workspace, $dimensions, $removedNodes, $recursive);
      
      

      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 reduceNodeVariantsByWorkspacesAndDimensions has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function reduceNodeVariantsByWorkspacesAndDimensions(array $nodes, array $workspaces, array $dimensions)
          {
              $reducedNodes = [];
      
              $minimalDimensionPositionsByIdentifier = [];

      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 setNewIndex has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setNewIndex(NodeData $node, $position, NodeInterface $referenceNode = null)
          {
              $parentPath = $node->getParentPath();
      
              switch ($position) {

      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 findOneByIdentifier has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public function findOneByIdentifier($identifier, Workspace $workspace, array $dimensions = null, $removedNodes = false)
          {
              $workspaces = [];
              while ($workspace !== null) {
                  /** @var $node NodeData */

      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 filterNodeDataByBestMatchInContext has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function filterNodeDataByBestMatchInContext(array $nodeDataObjects, Workspace $workspace, array $dimensions, $includeRemovedNodes = false)
          {
              $workspaces = $this->collectWorkspaceAndAllBaseWorkspaces($workspace);
              $nonPersistedNodes = [];
              $nodeIdentifier = [];

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

          public function setNewIndex(NodeData $node, $position, NodeInterface $referenceNode = null)
          {
              $parentPath = $node->getParentPath();
      
              switch ($position) {

        Function openIndexSpace has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function openIndexSpace($parentPath, $referenceIndex)
            {
                $this->systemLogger->info(sprintf('Opening sortindex space after index %s at path %s.', $referenceIndex, $parentPath), LogEnvironment::fromMethodName(__METHOD__));
        
                /** @var Query $query */

        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 findRawNodesByPath has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function findRawNodesByPath($path, Workspace $workspace, array $dimensions = null, $onlyShadowNodes = false)
            {
                $path = strtolower($path);
                if ($path === '' || ($path !== '/' && ($path[0] !== '/' || substr($path, -1, 1) === '/'))) {
                    throw new \InvalidArgumentException('"' . $path . '" is not a valid path: must start but not end with a slash.', 1284985489);

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

            protected function reduceNodeVariantsByWorkspacesAndDimensions(array $nodes, array $workspaces, array $dimensions)
            {
                $reducedNodes = [];
        
                $minimalDimensionPositionsByIdentifier = [];

          Method findByParentAndNodeType has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function findByParentAndNodeType($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions = null, $removedNodes = false, $recursive = false)
              {
                  $parentPath = strtolower($parentPath);
                  $foundNodes = $this->getNodeDataForParentAndNodeType($parentPath, $nodeTypeFilter, $workspace, $dimensions, $removedNodes, $recursive);
          
          

            Method openIndexSpace has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function openIndexSpace($parentPath, $referenceIndex)
                {
                    $this->systemLogger->info(sprintf('Opening sortindex space after index %s at path %s.', $referenceIndex, $parentPath), LogEnvironment::fromMethodName(__METHOD__));
            
                    /** @var Query $query */

              Method findOnPath has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function findOnPath($pathStartingPoint, $pathEndPoint, Workspace $workspace, array $dimensions = null, $includeRemovedNodes = false, $nodeTypeFilter = null)
                  {
                      $pathStartingPoint = strtolower($pathStartingPoint);
                      $pathEndPoint = strtolower($pathEndPoint);
                      if (NodePaths::isSubPathOf($pathStartingPoint, $pathEndPoint) === false) {

                Method filterNodeDataByBestMatchInContext has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function filterNodeDataByBestMatchInContext(array $nodeDataObjects, Workspace $workspace, array $dimensions, $includeRemovedNodes = false)
                    {
                        $workspaces = $this->collectWorkspaceAndAllBaseWorkspaces($workspace);
                        $nonPersistedNodes = [];
                        $nodeIdentifier = [];

                  Method findOneByIdentifier has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function findOneByIdentifier($identifier, Workspace $workspace, array $dimensions = null, $removedNodes = false)
                      {
                          $workspaces = [];
                          while ($workspace !== null) {
                              /** @var $node NodeData */

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

                        public function findByProperties($term, $nodeTypeFilter, $workspace, $dimensions, $pathStartingPoint = null)
                        {
                            if (empty($term)) {
                                throw new \InvalidArgumentException('"term" cannot be empty: provide a term to search for.', 1421329285);
                            }

                      Function getNodeTypeFilterConstraints has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function getNodeTypeFilterConstraints(QueryInterface $query, $nodeTypeFilter)
                          {
                              $includeNodeTypeConstraints = [];
                              $excludeNodeTypeConstraints = [];
                              $nodeTypeFilterParts = Arrays::trimExplode(',', $nodeTypeFilter);

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

                          protected function findRawNodesByPath($path, Workspace $workspace, array $dimensions = null, $onlyShadowNodes = false)
                          {
                              $path = strtolower($path);
                              if ($path === '' || ($path !== '/' && ($path[0] !== '/' || substr($path, -1, 1) === '/'))) {
                                  throw new \InvalidArgumentException('"' . $path . '" is not a valid path: must start but not end with a slash.', 1284985489);

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

                            protected function getNodeTypeFilterConstraintsForDql($nodeTypeFilter = '')
                            {
                                $nodeTypeFilter = empty($nodeTypeFilter) ? '' : $nodeTypeFilter;
                                $constraints = [
                                    'excludeNodeTypes' => [],

                        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

                        Consider simplifying this complex logical expression.
                        Open

                                    if (
                                        (($recursive && $addedNode->getDepth() >= $childNodeDepth) || $addedNode->getDepth() === $childNodeDepth) &&
                                        (($recursive && NodePaths::isSubPathOf($addedNode->getPath(), $parentPath)) || NodePaths::getParentPath($addedNode->getPath()) === $parentPath) &&
                                        $addedNode->matchesWorkspaceAndDimensions($workspace, $dimensions)
                                    ) {

                          Consider simplifying this complex logical expression.
                          Open

                                      if (
                                          (($recursive && $removedNode->getDepth() >= $childNodeDepth) || $removedNode->getDepth() === $childNodeDepth) &&
                                          (($recursive && NodePaths::isSubPathOf($removedNode->getPath(), $parentPath)) || NodePaths::getParentPath($removedNode->getPath()) === $parentPath) &&
                                          $removedNode->matchesWorkspaceAndDimensions($workspace, $dimensions)
                                      ) {

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

                                public function findByParentAndNodeType($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions = null, $removedNodes = false, $recursive = false)
                            Severity: Minor
                            Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 45 mins to fix

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

                                  protected function getNodeDataForParentAndNodeType($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions = null, $removedNodes = false, $recursive = false)
                              Severity: Minor
                              Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 45 mins to fix

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

                                    public function findOnPath($pathStartingPoint, $pathEndPoint, Workspace $workspace, array $dimensions = null, $includeRemovedNodes = false, $nodeTypeFilter = null)
                                Severity: Minor
                                Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 45 mins to fix

                                  Function findOnPath has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function findOnPath($pathStartingPoint, $pathEndPoint, Workspace $workspace, array $dimensions = null, $includeRemovedNodes = false, $nodeTypeFilter = null)
                                      {
                                          $pathStartingPoint = strtolower($pathStartingPoint);
                                          $pathEndPoint = strtolower($pathEndPoint);
                                          if (NodePaths::isSubPathOf($pathStartingPoint, $pathEndPoint) === false) {
                                  Severity: Minor
                                  Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 45 mins 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 findByProperties has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public function findByProperties($term, $nodeTypeFilter, $workspace, $dimensions, $pathStartingPoint = null)
                                  Severity: Minor
                                  Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 35 mins to fix

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

                                        public function countByParentAndNodeType($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions = null, $includeRemovedNodes = false)
                                    Severity: Minor
                                    Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 35 mins to fix

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

                                          public function findFirstByParentAndNodeType($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions, $removedNodes = false)
                                      Severity: Minor
                                      Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 35 mins to fix

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

                                            public function findByParentAndNodeTypeRecursively($parentPath, $nodeTypeFilter, Workspace $workspace, array $dimensions = null, $removedNodes = false)
                                        Severity: Minor
                                        Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 35 mins to fix

                                          Function findByParentWithoutReduce has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              public function findByParentWithoutReduce($parentPath, Workspace $workspace)
                                              {
                                                  $parentPath = strtolower($parentPath);
                                                  $workspaces = $this->collectWorkspaceAndAllBaseWorkspaces($workspace);
                                          
                                          
                                          Severity: Minor
                                          Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 35 mins 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 findByProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              public function findByProperties($term, $nodeTypeFilter, $workspace, $dimensions, $pathStartingPoint = null)
                                              {
                                                  if (empty($term)) {
                                                      throw new \InvalidArgumentException('"term" cannot be empty: provide a term to search for.', 1421329285);
                                                  }
                                          Severity: Minor
                                          Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 25 mins 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 buildQueryBuilderForRelationMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              protected function buildQueryBuilderForRelationMap($relationMap)
                                              {
                                                  /** @var QueryBuilder $queryBuilder */
                                                  $queryBuilder = $this->entityManager->createQueryBuilder();
                                          
                                          
                                          Severity: Minor
                                          Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 25 mins 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 findByPathWithoutReduce has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              public function findByPathWithoutReduce($path, Workspace $workspace, $includeRemovedNodes = false, $recursive = false)
                                              {
                                                  $path = strtolower($path);
                                                  $workspaces = $this->collectWorkspaceAndAllBaseWorkspaces($workspace);
                                          
                                          
                                          Severity: Minor
                                          Found in Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php - About 25 mins 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

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

                                              protected function addParentPathConstraintToQueryBuilder(QueryBuilder $queryBuilder, $parentPath, $recursive = false)
                                              {
                                                  if (!$recursive) {
                                                      $queryBuilder->andWhere('n.parentPathHash = :parentPathHash')
                                                          ->setParameter('parentPathHash', md5($parentPath));
                                          Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php on lines 1580..1593

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

                                          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 addPathConstraintToQueryBuilder(QueryBuilder $queryBuilder, $path, $recursive = false)
                                              {
                                                  if (!$recursive) {
                                                      $queryBuilder->andWhere('n.pathHash = :pathHash')
                                                          ->setParameter('pathHash', md5($path));
                                          Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php on lines 1559..1572

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

                                          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

                                                      if (
                                                          (($recursive && $addedNode->getDepth() >= $childNodeDepth) || $addedNode->getDepth() === $childNodeDepth) &&
                                                          (($recursive && NodePaths::isSubPathOf($addedNode->getPath(), $parentPath)) || NodePaths::getParentPath($addedNode->getPath()) === $parentPath) &&
                                                          $addedNode->matchesWorkspaceAndDimensions($workspace, $dimensions)
                                                      ) {
                                          Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php on lines 564..572

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

                                          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

                                                      if (
                                                          (($recursive && $removedNode->getDepth() >= $childNodeDepth) || $removedNode->getDepth() === $childNodeDepth) &&
                                                          (($recursive && NodePaths::isSubPathOf($removedNode->getPath(), $parentPath)) || NodePaths::getParentPath($removedNode->getPath()) === $parentPath) &&
                                                          $removedNode->matchesWorkspaceAndDimensions($workspace, $dimensions)
                                                      ) {
                                          Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php on lines 540..560

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

                                          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

                                          There are no issues that match your filters.

                                          Category
                                          Status