Showing 120 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

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

      <?php
      
      namespace PHPixie\ORM\Relationships\Type\Embeds\Type;
      
      class Many extends \PHPixie\ORM\Relationships\Type\Embeds
      Severity: Major
      Found in src/PHPixie/ORM/Relationships/Type/Embeds/Type/Many.php and 1 other location - About 5 hrs to fix
      src/PHPixie/ORM/Relationships/Type/Embeds/Type/One.php on lines 1..50

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

      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

      <?php
      
      namespace PHPixie\ORM\Relationships\Type\Embeds\Type;
      
      class One extends \PHPixie\ORM\Relationships\Type\Embeds
      Severity: Major
      Found in src/PHPixie/ORM/Relationships/Type/Embeds/Type/One.php and 1 other location - About 5 hrs to fix
      src/PHPixie/ORM/Relationships/Type/Embeds/Type/Many.php on lines 1..50

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

      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

      <?php
      
      namespace PHPixie\ORM\Drivers\Driver;
      
      class PDO extends \PHPixie\ORM\Drivers\Driver
      Severity: Major
      Found in src/PHPixie/ORM/Drivers/Driver/PDO.php and 1 other location - About 4 hrs to fix
      src/PHPixie/ORM/Drivers/Driver/Mongo.php on lines 1..46

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

      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

      <?php
      
      namespace PHPixie\ORM\Drivers\Driver;
      
      class Mongo extends \PHPixie\ORM\Drivers\Driver
      Severity: Major
      Found in src/PHPixie/ORM/Drivers/Driver/Mongo.php and 1 other location - About 4 hrs to fix
      src/PHPixie/ORM/Drivers/Driver/PDO.php on lines 1..46

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

      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

      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

                        Severity
                        Category
                        Status
                        Source
                        Language