Showing 108 of 120 total issues

Proxy has 72 functions (exceeds 20 allowed). Consider refactoring.
Open

class Proxy implements \PHPixie\ORM\Conditions\Builder
{
    protected $builder;
    protected $aliases = array(
        'and' => '_and',
Severity: Major
Found in src/PHPixie/ORM/Conditions/Builder/Proxy.php - About 1 day to fix

    Container has 59 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Container extends \PHPixie\Database\Conditions\Builder\Container
                    implements \PHPixie\ORM\Conditions\Builder
    {
        protected $conditions;
        protected $relationshipMap;
    Severity: Major
    Found in src/PHPixie/ORM/Conditions/Builder/Container.php - About 1 day to fix

      Builder has 32 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Builder
      {
          /**
           * @type \PHPixie\Database
           */
      Severity: Minor
      Found in src/PHPixie/ORM/Builder.php - About 4 hrs to fix

        Query has 30 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Query extends \PHPixie\ORM\Conditions\Builder\Proxy
                    implements \PHPixie\ORM\Models\Type\Database\Query
        {
            /**
             * @type \PHPixie\ORM\Values
        Severity: Minor
        Found in src/PHPixie/ORM/Models/Type/Database/Implementation/Query.php - About 3 hrs to fix

          File Proxy.php has 317 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace PHPixie\ORM\Conditions\Builder;
          
          class Proxy implements \PHPixie\ORM\Conditions\Builder
          Severity: Minor
          Found in src/PHPixie/ORM/Conditions/Builder/Proxy.php - About 3 hrs to fix

            Function processItems has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function processItems($action, $config, $items, $owner = null, $processOldOwner = true)
                {
                    if(!is_array($items))
                        $items = array($items);
            
            Severity: Minor
            Found in src/PHPixie/ORM/Relationships/Type/OneTo/Type/Many/Handler.php - About 3 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

            Query has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Query extends \PHPixie\ORM\Conditions\Builder\Proxy
                        implements \PHPixie\ORM\Models\Type\Database\Query
            {
                /**
                 * @type \PHPixie\ORM\Drivers\Driver\PDO\Query|\PHPixie\ORM\Drivers\Driver\Mongo\Query
            Severity: Minor
            Found in src/PHPixie/ORM/Wrappers/Type/Database/Query.php - About 3 hrs to fix

              Function extractCollections has a Cognitive Complexity of 23 (exceeds 5 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 3 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

              File Container.php has 302 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              namespace PHPixie\ORM\Conditions\Builder;
              
              class Container extends \PHPixie\Database\Conditions\Builder\Container
              Severity: Minor
              Found in src/PHPixie/ORM/Conditions/Builder/Container.php - About 3 hrs to fix

                Function processProperties has a Cognitive Complexity of 19 (exceeds 5 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 2 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

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

                    public function execute()
                    {
                        $modelConfig = $this->repository->config();
                        $config = $this->config;
                
                
                Severity: Major
                Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/MoveChild.php - About 2 hrs to fix

                  File Handler.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace PHPixie\ORM\Relationships\Type\ManyToMany;
                  
                  class Handler extends \PHPixie\ORM\Relationships\Relationship\Implementation\Handler
                  Severity: Minor
                  Found in src/PHPixie/ORM/Relationships/Type/ManyToMany/Handler.php - About 2 hrs to fix

                    Method mapDatabaseQuery has 57 lines of code (exceeds 25 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: Major
                    Found in src/PHPixie/ORM/Relationships/Type/OneTo/Handler.php - About 2 hrs to fix

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

                          public function execute()
                          {
                              $modelConfig = $this->repository->config();
                              $config = $this->config;
                      
                      
                      Severity: Major
                      Found in src/PHPixie/ORM/Relationships/Type/NestedSet/Steps/RemoveNodes.php - About 2 hrs to fix

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

                            protected function objectDiff($new, $old)
                            {
                                $newData = get_object_vars($new);
                                $oldData = get_object_vars($old);
                                $unset = array_values(array_diff(array_keys($oldData), array_keys($newData)));
                        Severity: Minor
                        Found in src/PHPixie/ORM/Data/Types/Document/Diffable.php - About 2 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

                        Function execute has a Cognitive Complexity of 16 (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/MoveChild.php - About 2 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

                        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
                                Severity
                                Category
                                Status
                                Source
                                Language