PHPixie/Database

View on GitHub

Showing 66 of 66 total issues

Item has 99 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Item extends \PHPixie\Database\Driver\Mongo\Query
                    implements \PHPixie\Database\Driver\Mongo\Conditions\Builder
{
    public function __construct($connection, $parser, $builder)
    {
Severity: Major
Found in src/PHPixie/Database/Driver/Mongo/Query/Item.php - About 1 day to fix

    Items has 93 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class Items extends \PHPixie\Database\Driver\PDO\Query
                         implements \PHPixie\Database\Type\SQL\Query\Items,
                                    \PHPixie\Database\Driver\PDO\Conditions\Builder
    {
    
    
    Severity: Major
    Found in src/PHPixie/Database/Driver/PDO/Query/Items.php - About 1 day to fix

      File Item.php has 418 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace PHPixie\Database\Driver\Mongo\Query;
      
      abstract class Item extends \PHPixie\Database\Driver\Mongo\Query
      Severity: Minor
      Found in src/PHPixie/Database/Driver/Mongo/Query/Item.php - About 6 hrs to fix

        File Items.php has 409 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace PHPixie\Database\Driver\PDO\Query;
        
        abstract class Items extends \PHPixie\Database\Driver\PDO\Query
        Severity: Minor
        Found in src/PHPixie/Database/Driver/PDO/Query/Items.php - About 5 hrs to fix

          Select has 36 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Select extends \PHPixie\Database\Driver\PDO\Query\Items implements \PHPixie\Database\Type\SQL\Query\Type\Select
          {
              public function type()
              {
                  return 'select';
          Severity: Minor
          Found in src/PHPixie/Database/Driver/PDO/Query/Type/Select.php - About 4 hrs to fix

            Function appendInsertValues has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function appendInsertValues($query, $expr)
                {
                    if (($insertData = $query->getBatchData()) !== null) {
                        $columns = $insertData['columns'];
                        $rows    = $insertData['rows'];
            Severity: Minor
            Found in src/PHPixie/Database/Type/SQL/Parser.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

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

            abstract class Container implements \PHPixie\Database\Conditions\Builder
            {
                protected $groupStack = array();
                protected $currentGroup;
                protected $defaultOperator;
            Severity: Minor
            Found in src/PHPixie/Database/Conditions/Builder/Container.php - About 3 hrs to fix

              Function parse has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function parse($conditions, $convertMongoId = true)
                  {
                      $expanded = $this->parseLogic($conditions);
                      
                      $andGroups = array();
              Severity: Minor
              Found in src/PHPixie/Database/Driver/Mongo/Parser/Conditions.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

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

              abstract class Builder
              {
              
                  protected $conditions;
              
              
              Severity: Minor
              Found in src/PHPixie/Database/Query/Implementation/Builder.php - About 3 hrs to fix

                File Parser.php has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace PHPixie\Database\Type\SQL;
                
                abstract class Parser extends \PHPixie\Database\Parser
                Severity: Minor
                Found in src/PHPixie/Database/Type/SQL/Parser.php - About 2 hrs to fix

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

                  abstract class Container extends    \PHPixie\Database\Conditions\Builder\Container\Conditions
                                           implements \PHPixie\Database\Type\Document\Conditions\Builder
                  {
                      public function __construct($conditions, $defaultOperator = '=')
                      {
                  Severity: Minor
                  Found in src/PHPixie/Database/Type/Document/Conditions/Builder/Container.php - About 2 hrs to fix

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

                        protected function addKeyValuesToArray($name, $args, $requireKeys = false, $firstParameterIsKey = true, $assertIsNumeric = false)
                        {
                            $array = $args[0];
                    
                            if (!is_array($array)) {
                    Severity: Minor
                    Found in src/PHPixie/Database/Query/Implementation/Builder.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 addAnd has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function addAnd($condition)
                        {
                            $newGroups = array();
                            if($condition instanceof ExpandedGroup) {
                                $groups = $condition->groups();

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

                        protected function appendInsertValues($query, $expr)
                        {
                            if (($insertData = $query->getBatchData()) !== null) {
                                $columns = $insertData['columns'];
                                $rows    = $insertData['rows'];
                    Severity: Minor
                    Found in src/PHPixie/Database/Type/SQL/Parser.php - About 1 hr to fix

                      Function appendUpdateValues has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function appendUpdateValues($query, $expr)
                          {
                              $expr->sql .= " SET ";
                              $set = $query->getSet();
                              $increment = $query->getIncrement();
                      Severity: Minor
                      Found in src/PHPixie/Database/Type/SQL/Parser.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 negate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function negate()
                          {
                              $groups = array(array());
                              $count = count($this->groups);
                              $negated = array();

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

                          public function appendTable($table, $expr, $alias = null)
                          {
                              if (is_string($table)) {
                                  $table = explode('.', $table);
                                  foreach($table as $key => $part) {
                      Severity: Minor
                      Found in src/PHPixie/Database/Type/SQL/Parser/Fragment.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 parse has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function parse($conditions, $convertMongoId = true)
                          {
                              $expanded = $this->parseLogic($conditions);
                              
                              $andGroups = array();
                      Severity: Minor
                      Found in src/PHPixie/Database/Driver/Mongo/Parser/Conditions.php - About 1 hr to fix

                        Method appendUpdateValues has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function appendUpdateValues($query, $expr)
                            {
                                $expr->sql .= " SET ";
                                $set = $query->getSet();
                                $increment = $query->getIncrement();
                        Severity: Minor
                        Found in src/PHPixie/Database/Type/SQL/Parser.php - About 1 hr to fix

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

                              protected function parseCompare($field, $operator, $values)
                              {
                                  $isColumn =  false;
                          
                                  if (substr($operator, -1, 1) === '*') {
                          Severity: Minor
                          Found in src/PHPixie/Database/Type/SQL/Parser/Operator.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

                          Severity
                          Category
                          Status
                          Source
                          Language