Showing 120 of 120 total issues

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

          Method mapCommon has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function mapCommon($query, $databaseQuery, $queryPlan)
              {
                  $modelName           = $query->modelName();
                  $conditions          = $query->getConditions();
                  $requiredPlan        = $queryPlan->requiredPlan();
          Severity: Minor
          Found in src/PHPixie/ORM/Mappers/Query.php - About 1 hr to fix

            Method linkPlan has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function linkPlan($config, $owner, $items)
                {
                    $ownerRepository = $this->getRepository($config->ownerModel);
                    $ownerQuery = $ownerRepository->databaseSelectQuery();
                    
            Severity: Minor
            Found in src/PHPixie/ORM/Relationships/Type/OneTo/Handler.php - About 1 hr to fix

              Method processProperties has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function processProperties($action, $owners, $ownerProperty, $items)
                  {
                      if (!is_array($owners))
                          $owners = array($owners);
              
              Severity: Minor
              Found in src/PHPixie/ORM/Relationships/Type/ManyToMany/Handler.php - About 1 hr to fix

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

                    protected function processOwner($action, $config, $owner, $items = array())
                    {
                        if(!is_array($items))
                            $items = array($items);
                        
                Severity: Minor
                Found in src/PHPixie/ORM/Relationships/Type/OneTo/Type/Many/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

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

                  Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function __construct($configs, $conditions, $data, $database, $models, $maps, $mappers, $values)
                  Severity: Major
                  Found in src/PHPixie/ORM/Drivers/Driver.php - About 1 hr to fix

                    Function getDocumentByExplodedPath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function getDocumentByExplodedPath($document, $explodedPath, $createMissing)
                        {
                            $last = count($explodedPath) - 1;
                            foreach($explodedPath as $i => $key) {
                                $property = $document->get($key);
                    Severity: Minor
                    Found in src/PHPixie/ORM/Planners/Planner/Document.php - About 55 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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function execute()
                        {
                            $fields = $this->fields();
                            $data = $this->dataStep->data();
                            $this->selectQuery->fields($fields);
                    Severity: Minor
                    Found in src/PHPixie/ORM/Steps/Step/Query/Insert/Batch/Data/Unique.php - About 55 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 in has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function in($query, $queryField, $subquery, $subqueryField, $plan, $logic = 'and', $negate = false)
                    Severity: Major
                    Found in src/PHPixie/ORM/Planners/Planner/In/Strategy/Subquery.php - About 50 mins to fix

                      Method subquery has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function subquery($query, $queryField, $subquery, $subqueryField, $plan, $logic = 'and', $negate = false)
                      Severity: Major
                      Found in src/PHPixie/ORM/Planners/Planner/In.php - About 50 mins to fix

                        Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function __construct($loaders, $side, $modelConfig, $result, $loader, $parentResult, $relatedLoader)
                        Severity: Major
                        Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Preloader.php - About 50 mins to fix

                          Method result has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function result($query, $queryField, $reusableResult, $resultField, $plan, $logic = 'and', $negate = false)
                          Severity: Major
                          Found in src/PHPixie/ORM/Planners/Planner/In.php - About 50 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language