Showing 108 of 120 total issues

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

    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

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

                  public function unlinkPlan($side, $items)
                  {
                      $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 processProperty has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function processProperty($type, $config, $entity, $action, $value = null, $unsetRelated = true)
                    {
                        if(!$this->isEntityValue($entity))
                            return;
                        
                Severity: Minor
                Found in src/PHPixie/ORM/Relationships/Type/OneTo/Type/One/Handler.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 add has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function add($items)
                    {
                        if(!is_array($items)) {
                            $items = array($items);
                        }
                Severity: Minor
                Found in src/PHPixie/ORM/Conditions/Condition/In.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 mapDatabaseQuery has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function mapDatabaseQuery($query, $side, $collectionCondition, $plan)
                    {
                        $config = $side->config();
                        $itemRepository = $this->getRepository($config->itemModel);
                        $ownerRepository = $this->getRepository($config->ownerModel);
                Severity: Minor
                Found in src/PHPixie/ORM/Relationships/Type/OneTo/Handler.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 map has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function map($updateDatabaseQuery, $update)
                    {
                        $set = array();
                        $remove = array();
                        $increments = array();
                Severity: Minor
                Found in src/PHPixie/ORM/Mappers/Update.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 handleDelete has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function handleDelete($side, $reusableResult, $plan, $sidePath)
                    {
                        $config = $side->config();
                        $itemKey = $config->ownerKey;
                        $itemModel = $config->itemModel;
                Severity: Minor
                Found in src/PHPixie/ORM/Relationships/Type/OneTo/Handler.php - About 1 hr to fix

                  Method mapTree has 29 lines of code (exceeds 25 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

                    Method mapDatabaseQuery has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function mapDatabaseQuery($query, $side, $collectionCondition, $plan)
                        {
                            $dependencies   = $this->getMappingDependencies($side);
                            $config         = $dependencies['config'];
                            $sideRepository = $dependencies['sideRepository'];
                    Severity: Minor
                    Found in src/PHPixie/ORM/Relationships/Type/ManyToMany/Handler.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language