qcubed/framework

View on GitHub
includes/database/QInformixPdoDatabase.class.php

Summary

Maintainability
F
1 wk
Test Coverage

Function SqlVariable has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

        public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                // Are we SqlVariabling a BOOLEAN value?
                if (is_bool($mixData)) {
                        // Yes
                        if ($blnIncludeEquality) {
Severity: Minor
Found in includes/database/QInformixPdoDatabase.class.php - About 1 day 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 QInformixPdoDatabase.class.php has 459 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * EXPERIMENTAL Informix database driver, based on PDO. 
 * 
 *
Severity: Minor
Found in includes/database/QInformixPdoDatabase.class.php - About 7 hrs to fix

    Function __construct has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct($mixFieldData, $objDb = null) {
            $objDatabaseRow = null;
            
            $objDatabaseRow = $mixFieldData ; // BG New 
                    
    Severity: Minor
    Found in includes/database/QInformixPdoDatabase.class.php - About 5 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 __construct has 98 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($mixFieldData, $objDb = null) {
            $objDatabaseRow = null;
            
            $objDatabaseRow = $mixFieldData ; // BG New 
                    
    Severity: Major
    Found in includes/database/QInformixPdoDatabase.class.php - About 3 hrs to fix

      The class QInformixPdoDatabase has an overall complexity of 61 which is very high. The configured complexity threshold is 50.
      Open

      class QInformixPdoDatabase extends QPdoDatabase {
              const Adapter = 'Informix PDO Database Adapter';
              const PDO_INFORMXIX_DSN_IDENTIFIER = 'informix'; // BG needed ?  
      
              public function Connect() {

      Method SqlVariable has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                      // Are we SqlVariabling a BOOLEAN value?
                      if (is_bool($mixData)) {
                              // Yes
                              if ($blnIncludeEquality) {
      Severity: Major
      Found in includes/database/QInformixPdoDatabase.class.php - About 2 hrs to fix

        Method GetForeignKeysForTable has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function GetForeignKeysForTable($strTableName) {
                        $objForeignKeyArray = array();
        
                        /** Postgres 
                                 *         // Use Query to pull the FKs
        Severity: Minor
        Found in includes/database/QInformixPdoDatabase.class.php - About 1 hr to fix

          Function SqlLimitVariablePrefix has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                  public function SqlLimitVariablePrefix($strLimitInfo) {
                          // Setup limit suffix (if applicable) via a LIMIT clause
                          if (strlen($strLimitInfo)) {
                                  if (strpos($strLimitInfo, ';') !== false)
                                          throw new Exception('Invalid Semicolon in LIMIT Info');
          Severity: Minor
          Found in includes/database/QInformixPdoDatabase.class.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 GetColumn has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function GetColumn($strColumnName, $strColumnType = null) {
                      if (!isset($this->strColumnArray[$strColumnName])) {
                          return null;
                      }
                      $strColumnValue = $this->strColumnArray[$strColumnName];
          Severity: Minor
          Found in includes/database/QInformixPdoDatabase.class.php - About 1 hr to fix

            Method getInformixPdoDsn has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    function getInformixPdoDsn($database, $host, $server, $service, $protocol) {
            Severity: Minor
            Found in includes/database/QInformixPdoDatabase.class.php - About 35 mins to fix

              Function GetForeignKeysForTable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function GetForeignKeysForTable($strTableName) {
                              $objForeignKeyArray = array();
              
                              /** Postgres 
                                       *         // Use Query to pull the FKs
              Severity: Minor
              Found in includes/database/QInformixPdoDatabase.class.php - About 35 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

              Avoid too many return statements within this method.
              Open

                                  return new QDateTime($strColumnValue);
              Severity: Major
              Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return $strToReturn . sprintf('%s', $mixData);
                Severity: Major
                Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                                                  return "= '0'";
                  Severity: Major
                  Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                        return QType::Cast($strColumnValue, QType::Float);
                    Severity: Major
                    Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return $strColumnValue;
                      Severity: Major
                      Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                                        return $strToReturn . sprintf("'%s'", $mixData->__toString('YYYY-MM-DD'));
                        Severity: Major
                        Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                                                  return "'0'";
                          Severity: Major
                          Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                    return $strToReturn . 'NULL';
                            Severity: Major
                            Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                                              return "!= '0'";
                              Severity: Major
                              Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return $strToReturn . sprintf("'%s'", addslashes($mixData));
                                Severity: Major
                                Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                                          return 'NULL';
                                  Severity: Major
                                  Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                        return QType::Cast($strColumnValue, QType::Integer);
                                    Severity: Major
                                    Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                                              return "'1'";
                                      Severity: Major
                                      Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                                        return $strToReturn . sprintf("'%s'", $mixData->__toString(QDateTime::FormatIso));
                                        Severity: Major
                                        Found in includes/database/QInformixPdoDatabase.class.php - About 30 mins to fix

                                          Function GetColumnsForConstraint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                                  public function GetColumnsForConstraint($intConstraintId, $intTableId){
                                                      $strColumnNameArray = array();
                                                      $strQuery = sprintf("
                                                                      SELECT a.constrid, b.* 
                                                                          FROM sysconstraints a, sysindexes b 
                                          Severity: Minor
                                          Found in includes/database/QInformixPdoDatabase.class.php - About 25 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

                                          The method __construct() has an NPath complexity of 1921. The configured NPath complexity threshold is 200.
                                          Open

                                              public function __construct($mixFieldData, $objDb = null) {
                                                  $objDatabaseRow = null;
                                                  
                                                  $objDatabaseRow = $mixFieldData ; // BG New 
                                                          

                                          NPathComplexity

                                          Since: 0.1

                                          The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                          Example

                                          class Foo {
                                              function bar() {
                                                  // lots of complicated code
                                              }
                                          }

                                          Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                          The method SqlVariable() has an NPath complexity of 900. The configured NPath complexity threshold is 200.
                                          Open

                                                  public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                                                          // Are we SqlVariabling a BOOLEAN value?
                                                          if (is_bool($mixData)) {
                                                                  // Yes
                                                                  if ($blnIncludeEquality) {

                                          NPathComplexity

                                          Since: 0.1

                                          The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                          Example

                                          class Foo {
                                              function bar() {
                                                  // lots of complicated code
                                              }
                                          }

                                          Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                          The method GetForeignKeysForTable() has 110 lines of code. Current threshold is set to 100. Avoid really long methods.
                                          Open

                                                  public function GetForeignKeysForTable($strTableName) {
                                                          $objForeignKeyArray = array();
                                          
                                                          /** Postgres 
                                                                   *         // Use Query to pull the FKs

                                          The method __construct() has 137 lines of code. Current threshold is set to 100. Avoid really long methods.
                                          Open

                                              public function __construct($mixFieldData, $objDb = null) {
                                                  $objDatabaseRow = null;
                                                  
                                                  $objDatabaseRow = $mixFieldData ; // BG New 
                                                          

                                          The method SqlVariable() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
                                          Open

                                                  public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                                                          // Are we SqlVariabling a BOOLEAN value?
                                                          if (is_bool($mixData)) {
                                                                  // Yes
                                                                  if ($blnIncludeEquality) {

                                          CyclomaticComplexity

                                          Since: 0.1

                                          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                          Example

                                          // Cyclomatic Complexity = 11
                                          class Foo {
                                          1   public function example() {
                                          2       if ($a == $b) {
                                          3           if ($a1 == $b1) {
                                                          fiddle();
                                          4           } elseif ($a2 == $b2) {
                                                          fiddle();
                                                      } else {
                                                          fiddle();
                                                      }
                                          5       } elseif ($c == $d) {
                                          6           while ($c == $d) {
                                                          fiddle();
                                                      }
                                          7        } elseif ($e == $f) {
                                          8           for ($n = 0; $n < $h; $n++) {
                                                          fiddle();
                                                      }
                                                  } else {
                                                      switch ($z) {
                                          9               case 1:
                                                              fiddle();
                                                              break;
                                          10              case 2:
                                                              fiddle();
                                                              break;
                                          11              case 3:
                                                              fiddle();
                                                              break;
                                                          default:
                                                              fiddle();
                                                              break;
                                                      }
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                          The method __construct() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10.
                                          Open

                                              public function __construct($mixFieldData, $objDb = null) {
                                                  $objDatabaseRow = null;
                                                  
                                                  $objDatabaseRow = $mixFieldData ; // BG New 
                                                          

                                          CyclomaticComplexity

                                          Since: 0.1

                                          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                          Example

                                          // Cyclomatic Complexity = 11
                                          class Foo {
                                          1   public function example() {
                                          2       if ($a == $b) {
                                          3           if ($a1 == $b1) {
                                                          fiddle();
                                          4           } elseif ($a2 == $b2) {
                                                          fiddle();
                                                      } else {
                                                          fiddle();
                                                      }
                                          5       } elseif ($c == $d) {
                                          6           while ($c == $d) {
                                                          fiddle();
                                                      }
                                          7        } elseif ($e == $f) {
                                          8           for ($n = 0; $n < $h; $n++) {
                                                          fiddle();
                                                      }
                                                  } else {
                                                      switch ($z) {
                                          9               case 1:
                                                              fiddle();
                                                              break;
                                          10              case 2:
                                                              fiddle();
                                                              break;
                                          11              case 3:
                                                              fiddle();
                                                              break;
                                                          default:
                                                              fiddle();
                                                              break;
                                                      }
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                          The method GetColumn() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                                          Open

                                                  public function GetColumn($strColumnName, $strColumnType = null) {
                                                      if (!isset($this->strColumnArray[$strColumnName])) {
                                                          return null;
                                                      }
                                                      $strColumnValue = $this->strColumnArray[$strColumnName];

                                          CyclomaticComplexity

                                          Since: 0.1

                                          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                          Example

                                          // Cyclomatic Complexity = 11
                                          class Foo {
                                          1   public function example() {
                                          2       if ($a == $b) {
                                          3           if ($a1 == $b1) {
                                                          fiddle();
                                          4           } elseif ($a2 == $b2) {
                                                          fiddle();
                                                      } else {
                                                          fiddle();
                                                      }
                                          5       } elseif ($c == $d) {
                                          6           while ($c == $d) {
                                                          fiddle();
                                                      }
                                          7        } elseif ($e == $f) {
                                          8           for ($n = 0; $n < $h; $n++) {
                                                          fiddle();
                                                      }
                                                  } else {
                                                      switch ($z) {
                                          9               case 1:
                                                              fiddle();
                                                              break;
                                          10              case 2:
                                                              fiddle();
                                                              break;
                                          11              case 3:
                                                              fiddle();
                                                              break;
                                                          default:
                                                              fiddle();
                                                              break;
                                                      }
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                          Missing class import via use statement (line '644', column '18').
                                          Open

                                                                  return new QInformixPdoDatabaseField($objField, $this->objDb);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '213', column '19').
                                          Open

                                                                          throw new QInformixDatabaseException('Invalid Limit Info: ' . $strLimitInfo, 0, null);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '224', column '19').
                                          Open

                                                                          throw new Exception('Invalid Semicolon in ORDER BY Info');

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '525', column '31').
                                          Open

                                                                              $objForeignKey = new QDatabaseForeignKey(

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '600', column '17').
                                          Open

                                                                  throw new QPdoDatabaseException($this->objPdo->errorInfo(), $this->objPdo->errorCode(), $strNonQuery);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '331', column '17').
                                          Open

                                                                  throw new Exception("Invalid Key Definition: $strKeyDefinition");

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '336', column '17').
                                          Open

                                                                  throw new Exception("Invalid Key Definition: $strKeyDefinition");

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          The method SqlVariable has a boolean flag argument $blnIncludeEquality, which is a certain sign of a Single Responsibility Principle violation.
                                          Open

                                                  public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {

                                          BooleanArgumentFlag

                                          Since: 1.4.0

                                          A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                          Example

                                          class Foo {
                                              public function bar($flag = true) {
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                          Missing class import via use statement (line '226', column '19').
                                          Open

                                                                          throw new Exception('Invalid Backtick in ORDER BY Info');

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '629', column '18').
                                          Open

                                                                  return new QInformixPdoDatabaseRow($strColumnArray);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '77', column '27').
                                          Open

                                                                  $this->objPdo = new PDO($strDsn, $this->Username, $this->Password);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '79', column '17').
                                          Open

                                                                  throw new QInformixDatabaseException(sprintf("Unable to connect to Database: %s",$expPgSql->getMessage()), -1, null);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '199', column '19').
                                          Open

                                                                          throw new Exception('Invalid Semicolon in LIMIT Info');

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '305', column '34').
                                          Open

                                                                  array_push($objFields, new QInformixPdoDatabaseField($objRow, $this));

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '687', column '17').
                                          Open

                                                              return new QDateTime($strColumnValue);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          The method SqlVariable has a boolean flag argument $blnReverseEquality, which is a certain sign of a Single Responsibility Principle violation.
                                          Open

                                                  public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {

                                          BooleanArgumentFlag

                                          Since: 1.4.0

                                          A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                          Example

                                          class Foo {
                                              public function bar($flag = true) {
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                          Missing class import via use statement (line '201', column '19').
                                          Open

                                                                          throw new Exception('Invalid Backtick in LIMIT Info');

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '414', column '23').
                                          Open

                                                                  $objIndex = new QDatabaseIndex($strKeyName, $blnPrimaryKey, $blnUnique, $strColumnNameArray);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '637', column '41').
                                          Open

                                                                  array_push($objArrayToReturn, new QInformixPdoDatabaseField($objField, $this->objDb));

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '849', column '16').
                                          Open

                                                              throw new QInformixSqlDatabaseException('Unsupported Field Type: ' . $intColType, 0, null);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '548', column '27').
                                          Open

                                                              $objForeignKey = new QDatabaseForeignKey(

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '575', column '18').
                                          Open

                                                                      throw new QPdoDatabaseException($this->objPdo->errorInfo(), $this->objPdo->errorCode(), $strQuery);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          Missing class import via use statement (line '588', column '42').
                                          Open

                                                          $objPdoStatementDatabaseResult = new QInformixPdoDatabaseResult($objResult, $this);

                                          MissingImport

                                          Since: 2.7.0

                                          Importing all external classes in a file through use statements makes them clearly visible.

                                          Example

                                          function make() {
                                              return new \stdClass();
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#MissingImport

                                          The method SqlLimitVariablePrefix uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                          Open

                                                                  } else {
                                                                          throw new QInformixDatabaseException('Invalid Limit Info: ' . $strLimitInfo, 0, null);
                                                                  }

                                          ElseExpression

                                          Since: 1.4.0

                                          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                          Example

                                          class Foo
                                          {
                                              public function bar($flag)
                                              {
                                                  if ($flag) {
                                                      // one branch
                                                  } else {
                                                      // another branch
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#elseexpression

                                          Avoid assigning values to variables in if clauses and the like (line '643', column '9').
                                          Open

                                                  public function FetchField() {
                                                          if ($objField = $this->FetchColumn())
                                                                  return new QInformixPdoDatabaseField($objField, $this->objDb);
                                                  }

                                          IfStatementAssignment

                                          Since: 2.7.0

                                          Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                          Example

                                          class Foo
                                          {
                                              public function bar($flag)
                                              {
                                                  if ($foo = 'bar') { // possible typo
                                                      // ...
                                                  }
                                                  if ($baz = 0) { // always false
                                                      // ...
                                                  }
                                              }
                                          }

                                          Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                                          The method SqlVariable uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                          Open

                                                                  } else {
                                                                          if (is_null($mixData))
                                                                                  $strToReturn = 'IS ';
                                                                          else
                                                                                  $strToReturn = '= ';

                                          ElseExpression

                                          Since: 1.4.0

                                          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                          Example

                                          class Foo
                                          {
                                              public function bar($flag)
                                              {
                                                  if ($flag) {
                                                      // one branch
                                                  } else {
                                                      // another branch
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#elseexpression

                                          The method GetColumn uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                          Open

                                                              } else {
                                                                  return ($strColumnValue) ? true : false;
                                                              }

                                          ElseExpression

                                          Since: 1.4.0

                                          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                          Example

                                          class Foo
                                          {
                                              public function bar($flag)
                                              {
                                                  if ($flag) {
                                                      // one branch
                                                  } else {
                                                      // another branch
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#elseexpression

                                          Avoid using static access to class 'QType' in method 'GetColumn'.
                                          Open

                                                              return QType::Cast($strColumnValue, QType::Integer);

                                          StaticAccess

                                          Since: 1.4.0

                                          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                          Example

                                          class Foo
                                          {
                                              public function bar()
                                              {
                                                  Bar::baz();
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#staticaccess

                                          Avoid using static access to class 'QType' in method 'GetColumn'.
                                          Open

                                                              return QType::Cast($strColumnValue, QType::String);

                                          StaticAccess

                                          Since: 1.4.0

                                          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                          Example

                                          class Foo
                                          {
                                              public function bar()
                                              {
                                                  Bar::baz();
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#staticaccess

                                          Avoid using static access to class 'QType' in method 'GetColumn'.
                                          Open

                                                              return QType::Cast($strColumnValue, QType::Float);

                                          StaticAccess

                                          Since: 1.4.0

                                          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                          Example

                                          class Foo
                                          {
                                              public function bar()
                                              {
                                                  Bar::baz();
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#staticaccess

                                          The method SqlVariable uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                          Open

                                                                  } else {
                                                                          // Check against NULL, True then False
                                                                          if (is_null($mixData))
                                                                                  return 'NULL';
                                                                          else if ($mixData)

                                          ElseExpression

                                          Since: 1.4.0

                                          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                          Example

                                          class Foo
                                          {
                                              public function bar($flag)
                                              {
                                                  if ($flag) {
                                                      // one branch
                                                  } else {
                                                      // another branch
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#elseexpression

                                          The method SqlVariable uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                          Open

                                                                          } else {
                                                                                  // Check against NULL, True then False
                                                                                  if (is_null($mixData))
                                                                                          return 'IS NULL';
                                                                                  else if ($mixData)

                                          ElseExpression

                                          Since: 1.4.0

                                          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                          Example

                                          class Foo
                                          {
                                              public function bar($flag)
                                              {
                                                  if ($flag) {
                                                      // one branch
                                                  } else {
                                                      // another branch
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#elseexpression

                                          The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                          Open

                                                  } else {
                                                      // Passed in fielddata is a ifx_fetch_field field result
                                                      $this->strName = $mixFieldData->name;
                                                      $this->strOriginalName = $mixFieldData->name;
                                                      $this->strTable = $mixFieldData->column_source;

                                          ElseExpression

                                          Since: 1.4.0

                                          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                          Example

                                          class Foo
                                          {
                                              public function bar($flag)
                                              {
                                                  if ($flag) {
                                                      // one branch
                                                  } else {
                                                      // another branch
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/cleancode.html#elseexpression

                                          Avoid unused parameters such as '$strTableName'.
                                          Open

                                                  public function InsertId($strTableName = null, $strColumnName = null) {

                                          UnusedFormalParameter

                                          Since: 0.2

                                          Avoid passing parameters to methods or constructors and then not using those parameters.

                                          Example

                                          class Foo
                                          {
                                              private function bar($howdy)
                                              {
                                                  // $howdy is not used
                                              }
                                          }

                                          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

                                          Avoid unused private methods such as 'ParseColumnNameArrayFromKeyDefinition'.
                                          Open

                                                  private function ParseColumnNameArrayFromKeyDefinition($strKeyDefinition) {
                                                          $strKeyDefinition = trim($strKeyDefinition);
                                          
                                                          // Get rid of the opening "(" and the closing ")"
                                                          $intPosition = strpos($strKeyDefinition, '(');

                                          UnusedPrivateMethod

                                          Since: 0.2

                                          Unused Private Method detects when a private method is declared but is unused.

                                          Example

                                          class Something
                                          {
                                              private function foo() {} // unused
                                          }

                                          Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

                                          Avoid unused parameters such as '$strLimitInfo'.
                                          Open

                                                  public function SqlLimitVariableSuffix($strLimitInfo) {

                                          UnusedFormalParameter

                                          Since: 0.2

                                          Avoid passing parameters to methods or constructors and then not using those parameters.

                                          Example

                                          class Foo
                                          {
                                              private function bar($howdy)
                                              {
                                                  // $howdy is not used
                                              }
                                          }

                                          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

                                          Avoid unused parameters such as '$strColumnName'.
                                          Open

                                                  public function InsertId($strTableName = null, $strColumnName = null) {

                                          UnusedFormalParameter

                                          Since: 0.2

                                          Avoid passing parameters to methods or constructors and then not using those parameters.

                                          Example

                                          class Foo
                                          {
                                              private function bar($howdy)
                                              {
                                                  // $howdy is not used
                                              }
                                          }

                                          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

                                          Avoid using count() function in for loops.
                                          Open

                                                          for ($intIndex = 0; $intIndex < count($strToReturn); $intIndex++) {
                                                                  $strColumn = $strToReturn[$intIndex];
                                          
                                                                  if (substr($strColumn, 0, 1) == '"')
                                                                          $strColumn = substr($strColumn, 1, strpos($strColumn, '"', 1) - 1);

                                          CountInLoopExpression

                                          Since: 2.7.0

                                          Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

                                          Example

                                          class Foo {
                                          
                                            public function bar()
                                            {
                                              $array = array();
                                          
                                              for ($i = 0; count($array); $i++) {
                                                // ...
                                              }
                                            }
                                          }

                                          Source https://phpmd.org/rules/design.html#countinloopexpression

                                          TODO found
                                          Open

                                                          // TODO: Current method doesn't support key names with commas or parenthesis in them!

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

                                                  public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                                                          // Are we SqlVariabling a BOOLEAN value?
                                                          if (is_bool($mixData)) {
                                                                  // Yes
                                                                  if ($blnIncludeEquality) {
                                          Severity: Major
                                          Found in includes/database/QInformixPdoDatabase.class.php and 1 other location - About 1 day to fix
                                          includes/database/QSqLite3PdoDatabase.class.php on lines 49..120

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

                                          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

                                          Identical blocks of code found in 3 locations. Consider refactoring.
                                          Open

                                                  private function ParseColumnNameArrayFromKeyDefinition($strKeyDefinition) {
                                                          $strKeyDefinition = trim($strKeyDefinition);
                                          
                                                          // Get rid of the opening "(" and the closing ")"
                                                          $intPosition = strpos($strKeyDefinition, '(');
                                          Severity: Major
                                          Found in includes/database/QInformixPdoDatabase.class.php and 2 other locations - About 1 day to fix
                                          includes/database/QPostgreSqlDatabase.class.php on lines 348..378
                                          includes/database/QPostgreSqlPdoDatabase.class.php on lines 253..283

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                          class QInformixPdoDatabaseRow extends QDatabaseRowBase {
                                                  protected $strColumnArray;
                                          
                                                  public function __construct($strColumnArray) {
                                                          $this->strColumnArray = $strColumnArray;
                                          Severity: Major
                                          Found in includes/database/QInformixPdoDatabase.class.php and 2 other locations - About 1 day to fix
                                          includes/database/QPostgreSqlPdoDatabase.class.php on lines 444..509
                                          includes/database/QSqLite3PdoDatabase.class.php on lines 339..403

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

                                          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 4 locations. Consider refactoring.
                                          Open

                                                  public function SqlLimitVariablePrefix($strLimitInfo) {
                                                          // Setup limit suffix (if applicable) via a LIMIT clause
                                                          if (strlen($strLimitInfo)) {
                                                                  if (strpos($strLimitInfo, ';') !== false)
                                                                          throw new Exception('Invalid Semicolon in LIMIT Info');
                                          Severity: Major
                                          Found in includes/database/QInformixPdoDatabase.class.php and 3 other locations - About 6 hrs to fix
                                          includes/database/QPostgreSqlDatabase.class.php on lines 127..149
                                          includes/database/QPostgreSqlPdoDatabase.class.php on lines 164..186
                                          includes/database/QSqLite3PdoDatabase.class.php on lines 128..149

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

                                          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 3 locations. Consider refactoring.
                                          Open

                                          class QInformixPdoDatabaseResult extends QPdoDatabaseResult {
                                          
                                                  public function GetNextRow() {
                                                          $strColumnArray = $this->FetchArray();
                                          
                                          
                                          Severity: Major
                                          Found in includes/database/QInformixPdoDatabase.class.php and 2 other locations - About 2 hrs to fix
                                          includes/database/QPostgreSqlPdoDatabase.class.php on lines 416..440
                                          includes/database/QSqLite3PdoDatabase.class.php on lines 311..334

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

                                          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 8 locations. Consider refactoring.
                                          Open

                                                  public function SqlSortByVariable($strSortByInfo) {
                                                          // Setup sorting information (if applicable) via a ORDER BY clause
                                                          if (strlen($strSortByInfo)) {
                                                                  if (strpos($strSortByInfo, ';') !== false)
                                                                          throw new Exception('Invalid Semicolon in ORDER BY Info');
                                          Severity: Major
                                          Found in includes/database/QInformixPdoDatabase.class.php and 7 other locations - About 45 mins to fix
                                          includes/database/QMySqliDatabase.class.php on lines 28..39
                                          includes/database/QMySqliDatabase.class.php on lines 41..53
                                          includes/database/QOracleDatabase.class.php on lines 60..72
                                          includes/database/QPostgreSqlDatabase.class.php on lines 151..163
                                          includes/database/QPostgreSqlPdoDatabase.class.php on lines 188..200
                                          includes/database/QSqlServer2005Database.class.php on lines 208..220
                                          includes/database/QSqlServerDatabase.class.php on lines 153..165

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

                                          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 5 locations. Consider refactoring.
                                          Open

                                                  public function GetFieldsForTable($strTableName) {
                                                          $strTableName = $this->SqlVariable($strTableName);
                                                          /** Postgres 
                                                           *         $strQuery = sprintf('
                                                           *                 SELECT
                                          Severity: Major
                                          Found in includes/database/QInformixPdoDatabase.class.php and 4 other locations - About 45 mins to fix
                                          includes/database/QPostgreSqlDatabase.class.php on lines 274..308
                                          includes/database/QPostgreSqlPdoDatabase.class.php on lines 210..240
                                          includes/database/QSqlServer2005Database.class.php on lines 364..390
                                          includes/database/QSqlServerDatabase.class.php on lines 311..336

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

                                          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

                                          Avoid excessively long variable names like $strReferenceTableName. Keep variable name length under 20.
                                          Open

                                                                              $strReferenceTableName,

                                          LongVariable

                                          Since: 0.2

                                          Detects when a field, formal or local variable is declared with a long name.

                                          Example

                                          class Something {
                                              protected $reallyLongIntName = -3; // VIOLATION - Field
                                              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                                  $otherReallyLongName = -5; // VIOLATION - Local
                                                  for ($interestingIntIndex = 0; // VIOLATION - For
                                                       $interestingIntIndex < 10;
                                                       $interestingIntIndex++ ) {
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/naming.html#longvariable

                                          Avoid excessively long variable names like $strReferenceColumnNameArray. Keep variable name length under 20.
                                          Open

                                                                              $strReferenceColumnNameArray);

                                          LongVariable

                                          Since: 0.2

                                          Detects when a field, formal or local variable is declared with a long name.

                                          Example

                                          class Something {
                                              protected $reallyLongIntName = -3; // VIOLATION - Field
                                              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                                  $otherReallyLongName = -5; // VIOLATION - Local
                                                  for ($interestingIntIndex = 0; // VIOLATION - For
                                                       $interestingIntIndex < 10;
                                                       $interestingIntIndex++ ) {
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/naming.html#longvariable

                                          Avoid excessively long variable names like $objPdoStatementDatabaseResult. Keep variable name length under 20.
                                          Open

                                                          $objPdoStatementDatabaseResult = new QInformixPdoDatabaseResult($objResult, $this);

                                          LongVariable

                                          Since: 0.2

                                          Detects when a field, formal or local variable is declared with a long name.

                                          Example

                                          class Something {
                                              protected $reallyLongIntName = -3; // VIOLATION - Field
                                              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                                  $otherReallyLongName = -5; // VIOLATION - Local
                                                  for ($interestingIntIndex = 0; // VIOLATION - For
                                                       $interestingIntIndex < 10;
                                                       $interestingIntIndex++ ) {
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/naming.html#longvariable

                                          Avoid excessively long variable names like $intReferenceConstraintId. Keep variable name length under 20.
                                          Open

                                                                          $intReferenceConstraintId = $objRow->GetColumn('pconstrid');

                                          LongVariable

                                          Since: 0.2

                                          Detects when a field, formal or local variable is declared with a long name.

                                          Example

                                          class Something {
                                              protected $reallyLongIntName = -3; // VIOLATION - Field
                                              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                                  $otherReallyLongName = -5; // VIOLATION - Local
                                                  for ($interestingIntIndex = 0; // VIOLATION - For
                                                       $interestingIntIndex < 10;
                                                       $interestingIntIndex++ ) {
                                                  }
                                              }
                                          }

                                          Source https://phpmd.org/rules/naming.html#longvariable

                                          Constant Adapter should be defined in uppercase
                                          Open

                                                  const Adapter = 'Informix PDO Database Adapter';

                                          ConstantNamingConventions

                                          Since: 0.2

                                          Class/Interface constant names should always be defined in uppercase.

                                          Example

                                          class Foo {
                                              const MY_NUM = 0; // ok
                                              const myTest = ""; // fail
                                          }

                                          Source https://phpmd.org/rules/naming.html#constantnamingconventions

                                          The method SqlVariable is not named in camelCase.
                                          Open

                                                  public function SqlVariable($mixData, $blnIncludeEquality = false, $blnReverseEquality = false) {
                                                          // Are we SqlVariabling a BOOLEAN value?
                                                          if (is_bool($mixData)) {
                                                                  // Yes
                                                                  if ($blnIncludeEquality) {

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method SqlLimitVariablePrefix is not named in camelCase.
                                          Open

                                                  public function SqlLimitVariablePrefix($strLimitInfo) {
                                                          // Setup limit suffix (if applicable) via a LIMIT clause
                                                          if (strlen($strLimitInfo)) {
                                                                  if (strpos($strLimitInfo, ';') !== false)
                                                                          throw new Exception('Invalid Semicolon in LIMIT Info');

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method SqlSortByVariable is not named in camelCase.
                                          Open

                                                  public function SqlSortByVariable($strSortByInfo) {
                                                          // Setup sorting information (if applicable) via a ORDER BY clause
                                                          if (strlen($strSortByInfo)) {
                                                                  if (strpos($strSortByInfo, ';') !== false)
                                                                          throw new Exception('Invalid Semicolon in ORDER BY Info');

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetColumn is not named in camelCase.
                                          Open

                                                  public function GetColumn($strColumnName, $strColumnType = null) {
                                                      if (!isset($this->strColumnArray[$strColumnName])) {
                                                          return null;
                                                      }
                                                      $strColumnValue = $this->strColumnArray[$strColumnName];

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method ExecuteNonQuery is not named in camelCase.
                                          Open

                                                  protected function ExecuteNonQuery($strNonQuery) {
                                                          $strNonQuery = $this->QueryStringToInformixSyntax ($strNonQuery);  
                                          
                                                          // Perform the Query
                                                          $objResult = $this->objPdo->query($strNonQuery);

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method QueryStringToInformixSyntax is not named in camelCase.
                                          Open

                                                  function QueryStringToInformixSyntax ( $strQuery ) {
                                                          $strQuery = str_replace('"','',$strQuery); //
                                                          //remove backslash from escaped characters like \" and \\
                                                          $strQuery = stripslashes($strQuery);
                                                          

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method FetchFields is not named in camelCase.
                                          Open

                                                  public function FetchFields() {
                                                          $objArrayToReturn = array();
                                                          while ($objField = $this->FetchColumn()) {
                                                                  array_push($objArrayToReturn, new QInformixPdoDatabaseField($objField, $this->objDb));
                                                          }

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetTableForId is not named in camelCase.
                                          Open

                                                  public function GetTableForId($intTableId) {
                                                      $intTableId = $this->SqlVariable($intTableId);
                                                      $strQuery = sprintf('
                                                              SELECT tabname
                                                              FROM systables

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method ColumnExists is not named in camelCase.
                                          Open

                                                  public function ColumnExists($strColumnName) {
                                                      return array_key_exists($strColumnName, $this->strColumnArray);
                                                  }

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetTables is not named in camelCase.
                                          Open

                                                  public function GetTables() {
                                                      // Postgres / $objResult = $this->Query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = current_schema() ORDER BY TABLE_NAME ASC");
                                                      
                                                      // BG copy fom  InformixSql  
                                                      $objResult = $this->Query(

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetIndexesForTable is not named in camelCase.
                                          Open

                                                  public function GetIndexesForTable($strTableName) {
                                                          $objIndexArray = array();
                                          
                                                          /**
                                                           *         $objResult = $this->Query(sprintf('

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetFieldsForTable is not named in camelCase.
                                          Open

                                                  public function GetFieldsForTable($strTableName) {
                                                          $strTableName = $this->SqlVariable($strTableName);
                                                          /** Postgres 
                                                           *         $strQuery = sprintf('
                                                           *                 SELECT

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetColumnNameArray is not named in camelCase.
                                          Open

                                                  public function GetColumnNameArray() {
                                                          return $this->strColumnArray;
                                                  }

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetForeignKeysForTable is not named in camelCase.
                                          Open

                                                  public function GetForeignKeysForTable($strTableName) {
                                                          $objForeignKeyArray = array();
                                          
                                                          /** Postgres 
                                                                   *         // Use Query to pull the FKs

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method Connect is not named in camelCase.
                                          Open

                                                  public function Connect() {
                                                          // Lookup Adapter-Specific Connection Properties
                                                          // $strDsn = sprintf("%s:host=%s;dbname=%s;port=%s",QInformixPdoDatabase::PDO_PGSQL_DSN_IDENTIFIER, $this->Server, $this->Database, $this->Port);
                                          
                                                          $strDsn = $this->getInformixPdoDsn($this->Database, $this->Host, $this->Server, $this->Service, $this->Protocol); // BG 

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method FetchField is not named in camelCase.
                                          Open

                                                  public function FetchField() {
                                                          if ($objField = $this->FetchColumn())
                                                                  return new QInformixPdoDatabaseField($objField, $this->objDb);
                                                  }

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method InsertId is not named in camelCase.
                                          Open

                                                  public function InsertId($strTableName = null, $strColumnName = null) {
                                                          /** Postgres 
                                                           *         $strQuery = sprintf('
                                                           *                 SELECT currval(pg_get_serial_sequence(%s, %s))
                                                           *             ', $this->SqlVariable($strTableName), $this->SqlVariable($strColumnName));

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method Close is not named in camelCase.
                                          Open

                                                  public function Close()
                                                  {
                                                      parent::Close();
                                          
                                                      // Update Connected Flag

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method ExecuteQuery is not named in camelCase.
                                          Open

                                                  protected function ExecuteQuery($strQuery) {
                                                          $strQuery = $this->QueryStringToInformixSyntax ($strQuery);  
                                          
                                                          // echo "$strQuery <br>" ;
                                                          // $objResult = $this->objPdo->query($strQuery);

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method SqlLimitVariableSuffix is not named in camelCase.
                                          Open

                                                  public function SqlLimitVariableSuffix($strLimitInfo) {
                                                          // BG changed, in the ifx-adapter, LIMIt is via Prefix 
                                                          // Informix uses Limit by prefix (via a LIMIT clause)
                                                          return null;
                                                  }

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method ParseColumnNameArrayFromKeyDefinition is not named in camelCase.
                                          Open

                                                  private function ParseColumnNameArrayFromKeyDefinition($strKeyDefinition) {
                                                          $strKeyDefinition = trim($strKeyDefinition);
                                          
                                                          // Get rid of the opening "(" and the closing ")"
                                                          $intPosition = strpos($strKeyDefinition, '(');

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetNextRow is not named in camelCase.
                                          Open

                                                  public function GetNextRow() {
                                                          $strColumnArray = $this->FetchArray();
                                          
                                                          if ($strColumnArray)
                                                                  return new QInformixPdoDatabaseRow($strColumnArray);

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          The method GetColumnsForConstraint is not named in camelCase.
                                          Open

                                                  public function GetColumnsForConstraint($intConstraintId, $intTableId){
                                                      $strColumnNameArray = array();
                                                      $strQuery = sprintf("
                                                                      SELECT a.constrid, b.* 
                                                                          FROM sysconstraints a, sysindexes b 

                                          CamelCaseMethodName

                                          Since: 0.2

                                          It is considered best practice to use the camelCase notation to name methods.

                                          Example

                                          class ClassName {
                                              public function get_name() {
                                              }
                                          }

                                          Source

                                          There are no issues that match your filters.

                                          Category
                                          Status