YetiForceCompany/YetiForceCRM

View on GitHub
app/Db.php

Summary

Maintainability
A
3 hrs
Test Coverage
F
52%

Method getDbInfo has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getDbInfo(): array
    {
        $return = [
            'isFileSize' => false,
            'size' => 0,
Severity: Minor
Found in app/Db.php - About 1 hr to fix

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

        public function getInfo()
        {
            $pdo = $this->getSlavePdo();
            $statement = $pdo->prepare('SHOW VARIABLES');
            $statement->execute();
    Severity: Minor
    Found in app/Db.php - About 1 hr to fix

      Function getDbInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getDbInfo(): array
          {
              $return = [
                  'isFileSize' => false,
                  'size' => 0,
      Severity: Minor
      Found in app/Db.php - About 45 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

      Missing class import via use statement (line '275', column '25').
      Open

                      $pdoCollector = new \DebugBar\DataCollector\PDO\PDOCollector();
      Severity: Minor
      Found in app/Db.php by phpmd

      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 '303', column '15').
      Open

                  $id = (new \App\Db\Query())
      Severity: Minor
      Found in app/Db.php by phpmd

      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 getUniqueID has a boolean flag argument $columnName, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function getUniqueID($tableName, $columnName = false, $seq = true)
      Severity: Minor
      Found in app/Db.php by phpmd

      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 '297', column '15').
      Open

                  $id = (new \App\Db\Query())->from($tableName)->scalar($this);
      Severity: Minor
      Found in app/Db.php by phpmd

      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 getUniqueID has a boolean flag argument $seq, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function getUniqueID($tableName, $columnName = false, $seq = true)
      Severity: Minor
      Found in app/Db.php by phpmd

      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

      Avoid using static access to class 'App\Config' in method 'getConfig'.
      Open

                  self::$config[$type] = Config::db($type) ?? Config::db('base');
      Severity: Minor
      Found in app/Db.php by phpmd

      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 createPdoInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $pdoCollector = new \DebugBar\DataCollector\PDO\PDOCollector();
                      $pdoCollector->addConnection($pdo, $this->dbType);
                      $bebugBar->addCollector($pdoCollector);
                  }
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Cache' in method 'getTableKeys'.
      Open

              if (Cache::has('getTableKeys', $tableName)) {
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Cache' in method 'getTableKeys'.
      Open

                  return Cache::get('getTableKeys', $tableName);
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Debuger' in method 'createPdoInstance'.
      Open

              if (Debuger::isDebugBar()) {
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Debuger' in method 'createPdoInstance'.
      Open

                  $bebugBar = Debuger::getDebugBar();
      Severity: Minor
      Found in app/Db.php by phpmd

      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 getUniqueID uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $id = (new \App\Db\Query())
                      ->from($tableName)
                      ->max($columnName, $this);
                  ++$id;
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Config' in method 'getConfig'.
      Open

                  self::$config[$type] = Config::db($type) ?? Config::db('base');
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Cache' in method 'getPrimaryKey'.
      Open

              Cache::save('getPrimaryKey', $tableName, $key, Cache::LONG);
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Cache' in method 'getPrimaryKey'.
      Open

              if (Cache::has('getPrimaryKey', $tableName)) {
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Cache' in method 'getTableKeys'.
      Open

              Cache::save('getTableKeys', $tableName, $keys, Cache::LONG);
      Severity: Minor
      Found in app/Db.php by phpmd

      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 'App\Cache' in method 'getPrimaryKey'.
      Open

                  return Cache::get('getPrimaryKey', $tableName);
      Severity: Minor
      Found in app/Db.php by phpmd

      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

      Define a constant instead of duplicating this literal "getPrimaryKey" 3 times.
      Open

              if (Cache::has('getPrimaryKey', $tableName)) {
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "yii\db\mssql\Schema" 3 times.
      Open

              'sqlsrv' => 'yii\db\mssql\Schema', // newer MSSQL driver on MS Windows hosts
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "Data_length" 3 times.
      Open

                      'dataSize' => $row['Data_length'],
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "indexSize" 3 times.
      Open

                  'indexSize' => 0,
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "version_comment" 3 times.
      Open

              $conf['version_comment'] = $conf['version_comment'] . '|' . $fullVersion;
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "mysql" 4 times.
      Open

              'mysql' => 'App\Db\Drivers\Mysql\Schema', // MySQL
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "tables" 4 times.
      Open

                  'tables' => [],
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "PRIMARY" 3 times.
      Open

                  $key = isset($tableKeys['PRIMARY']) ? ['PRIMARY' => array_keys($tableKeys['PRIMARY'])] : [];
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "ALLOCATED_SIZE" 3 times.
      Open

                      if (!empty($row['ALLOCATED_SIZE'])) {
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "Index_length" 3 times.
      Open

                      'indexSize' => $row['Index_length'],
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "dataSize" 3 times.
      Open

                  'dataSize' => 0,
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "getTableKeys" 3 times.
      Open

              if (Cache::has('getTableKeys', $tableName)) {
      Severity: Critical
      Found in app/Db.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Avoid using empty try-catch blocks in getDbInfo.
      Open

              } catch (\Throwable $th) {
              }
      Severity: Minor
      Found in app/Db.php by phpmd

      EmptyCatchBlock

      Since: 2.7.0

      Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

      Example

      class Foo {
      
        public function bar()
        {
            try {
                // ...
            } catch (Exception $e) {} // empty catch block
        }
      }

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

      Call with 1 arg(s) to \App\Db::__construct() which only takes 0 arg(s) defined at /code/app/Db.php:15
      Open

              $db = new self(self::getConfig($type));
      Severity: Info
      Found in app/Db.php by phan

      Call to undeclared method \App\Db\Query::from
      Open

                  $id = (new \App\Db\Query())->from($tableName)->scalar($this);
      Severity: Critical
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getDriverName
      Open

              if ('mysql' === $this->getDriverName()) {
      Severity: Critical
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::quoteTableName
      Open

              $tableName = $this->quoteTableName(str_replace('#__', $this->tablePrefix, $tableName));
      Severity: Critical
      Found in app/Db.php by phan

      Reference to undeclared property \App\Db->tablePrefix
      Open

              return str_replace('#__', $this->tablePrefix, $sql);
      Severity: Minor
      Found in app/Db.php by phan

      Method \App\Db::createTable is declared to return bool but has no return value
      Open

          public function createTable($tableName, $columns)
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

                  $dataReader = $this->createCommand()->setSql('SHOW KEYS FROM ' . $tableName)->query();
      Severity: Critical
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getSchema
      Open

              return \in_array(str_replace('#__', $this->tablePrefix, $tableName), $this->getSchema()->getTableNames());
      Severity: Critical
      Found in app/Db.php by phan

      Assigning false to property but \App\Db->schemaCache is \App\Cache|string
      Open

          public $schemaCache = false;
      Severity: Minor
      Found in app/Db.php by phan

      Reference to undeclared class \yii\db\Connection
      Open

              return parent::createPdoInstance();
      Severity: Critical
      Found in app/Db.php by phan

      Parameter $tableName has undeclared type \App\type
      Open

          public function getPrimaryKey($tableName)
      Severity: Minor
      Found in app/Db.php by phan

      Argument 1 (tableName) is \App\type but \App\Db::getTableKeys() takes string defined at /code/app/Db.php:347
      Open

                  $tableKeys = $this->getTableKeys($tableName);
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getSlavePdo
      Open

              $statement = $this->getSlavePdo()->prepare("SHOW TABLE STATUS FROM `{$this->dbName}`");
      Severity: Critical
      Found in app/Db.php by phan

      Reference to undeclared class \yii\db\Connection
      Open

                  $pdo = new Debug\DebugBar\TraceablePDO(parent::createPdoInstance());
      Severity: Critical
      Found in app/Db.php by phan

      Reference to undeclared property \App\Db->tablePrefix
      Open

              $tableName = $this->quoteTableName(str_replace('#__', $this->tablePrefix, $tableName));
      Severity: Minor
      Found in app/Db.php by phan

      Class extends undeclared class \yii\db\Connection
      Open

      class Db extends \yii\db\Connection
      Severity: Critical
      Found in app/Db.php by phan

      Call to method __construct from undeclared class \DebugBar\DataCollector\PDO\PDOCollector
      Open

                      $pdoCollector = new \DebugBar\DataCollector\PDO\PDOCollector();
      Severity: Critical
      Found in app/Db.php by phan

      Call to undeclared method \App\Debug\DebugBar\DebugBar::addCollector
      Open

                      $bebugBar->addCollector($pdoCollector);
      Severity: Critical
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getSlavePdo
      Open

              $pdo = $this->getSlavePdo();
      Severity: Critical
      Found in app/Db.php by phan

      Reference to undeclared property \App\Db->tablePrefix
      Open

              return parent::getLastInsertID(str_replace('#__', $this->tablePrefix, $sequenceName));
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

              $this->createCommand()->createTable($tableName, $columns, $tableOptions)->execute();
      Severity: Critical
      Found in app/Db.php by phan

      Argument 2 (key) is \App\type but \App\Cache::save() takes string defined at /code/app/Cache.php:89
      Open

              Cache::save('getPrimaryKey', $tableName, $key, Cache::LONG);
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Debug\DebugBar\DebugBar::getCollector
      Open

                      $pdoCollector = $bebugBar->getCollector('pdo');
      Severity: Critical
      Found in app/Db.php by phan

      Assigning array{} to property but \App\Db::$cache is \App\Db
      Open

          private static $cache = [];
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Debug\DebugBar\DebugBar::hasCollector
      Open

                  if ($bebugBar->hasCollector('pdo')) {
      Severity: Critical
      Found in app/Db.php by phan

      Argument 2 (key) is \App\type but \App\Cache::has() takes string defined at /code/app/Cache.php:74
      Open

              if (Cache::has('getPrimaryKey', $tableName)) {
      Severity: Minor
      Found in app/Db.php by phan

      Argument 2 (key) is \App\type but \App\Cache::get() takes string defined at /code/app/Cache.php:61
      Open

                  return Cache::get('getPrimaryKey', $tableName);
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getDriverName
      Open

                  'driver' => $this->getDriverName(),
      Severity: Critical
      Found in app/Db.php by phan

      Returning type \App\Debug\DebugBar\TraceablePDO but createPdoInstance() is declared to return \App\PDO
      Open

                  return $pdo;
      Severity: Minor
      Found in app/Db.php by phan

      Reference to undeclared class \yii\db\Connection
      Open

              return parent::getLastInsertID(str_replace('#__', $this->tablePrefix, $sequenceName));
      Severity: Critical
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getDriverName
      Open

              if ('mysql' === $this->getDriverName()) {
      Severity: Critical
      Found in app/Db.php by phan

      Call to method addConnection from undeclared class \DebugBar\DataCollector\PDO\PDOCollector
      Open

                      $pdoCollector->addConnection($pdo, $this->dbType);
      Severity: Critical
      Found in app/Db.php by phan

      Return type of getPrimaryKey() is undeclared type \App\type
      Open

          public function getPrimaryKey($tableName)
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getSlavePdo
      Open

                  $statement = $this->getSlavePdo()->prepare("SELECT * FROM `information_schema`.`INNODB_SYS_TABLESPACES` WHERE `NAME` LIKE '{$this->dbName}/%'");
      Severity: Critical
      Found in app/Db.php by phan

      Return type of createPdoInstance() is undeclared type \App\PDO (Did you mean class \PDO)
      Open

          protected function createPdoInstance()
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::createCommand
      Open

                  $this->createCommand()->update($tableName, [
      Severity: Critical
      Found in app/Db.php by phan

      Call to undeclared method \App\Db::getDriverName
      Open

              if ('mysql' === $this->getDriverName()) {
      Severity: Critical
      Found in app/Db.php by phan

      Returning type array{PRIMARY:array<int>|array<int>}|array{}</int></int> but getPrimaryKey() is declared to return \App\type
      Open

              return $key;
      Severity: Minor
      Found in app/Db.php by phan

      Call to undeclared method \App\Db\Query::from
      Open

                  $id = (new \App\Db\Query())
      Severity: Critical
      Found in app/Db.php by phan

      Reference to undeclared property \App\Db->tablePrefix
      Open

              return \in_array(str_replace('#__', $this->tablePrefix, $tableName), $this->getSchema()->getTableNames());
      Severity: Minor
      Found in app/Db.php by phan

      Either remove or fill this block of code.
      Open

              } catch (\Throwable $th) {
              }
      Severity: Major
      Found in app/Db.php by sonar-php

      Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

      Noncompliant Code Example

      for ($i = 0; $i < 42; $i++){}  // Empty on purpose or missing piece of code ?
      

      Exceptions

      When a block contains a comment, this block is not considered to be empty.

      Avoid classes with short names like Db. Configured minimum length is 3.
      Open

      class Db extends \yii\db\Connection
      {
          /**
           * Sorting order flag.
           */
      Severity: Minor
      Found in app/Db.php by phpmd

      ShortClassName

      Since: 2.9

      Detects when classes or interfaces have a very short name.

      Example

      class Fo {
      
      }
      
      interface Fo {
      
      }

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

      Avoid variables with short names like $db. Configured minimum length is 3.
      Open

              $db = new self(self::getConfig($type));
      Severity: Minor
      Found in app/Db.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

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

      Avoid variables with short names like $id. Configured minimum length is 3.
      Open

                  $id = (new \App\Db\Query())->from($tableName)->scalar($this);
      Severity: Minor
      Found in app/Db.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

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

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Sorting order flag.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var string Database Name
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $dbName;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var string Host database server
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'mysqli' => 'yii\db\mysql\Schema', // MySQL
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'sqlite' => 'yii\db\sqlite\Schema', // sqlite 3
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Creates the Db connection instance.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $type Name of database connection
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Set database connection configuration.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $type
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement = $pdo->prepare('SHOW VARIABLES');
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $typeDb = 'MySQL';
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'maximumMemorySize' => $memory,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $emulatePrepare = false;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'pgsql' => 'App\Db\Drivers\Pgsql\Schema', // PostgreSQL
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var string the class used to create new database [[Command]] objects. If you want to extend the [[Command]] class,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return \App\Db
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $pdo = $this->getSlavePdo();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement->execute();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return \array_merge($conf, [
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'filesSize' => 0,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Sorting order flag.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public const ASC = 'ASC';
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var bool whether to turn on prepare emulation. Defaults to false, meaning PDO
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $db = new self(self::getConfig($type));
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              self::$config[$type] = $config;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $memory = $conf['key_buffer_size'] + ($conf['query_cache_size'] ?? 0) + $conf['tmp_table_size'] + $conf['innodb_buffer_pool_size'] +
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'size' => 0,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              try {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Creates the PDO instance.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $bebugBar = Debuger::getDebugBar();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $tableName
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $tableName
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Get table keys.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $tableName
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public static function getInstance($type = 'base')
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement = $pdo->prepare('SHOW STATUS');
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $return = [
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return str_replace('#__', $this->tablePrefix, $sql);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $sequenceName name of the sequence object (required by some DBMS) ex. table vtiger_picklist >>> vtiger_picklist_picklistid_seq
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return $pdo;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return parent::createPdoInstance();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return int
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } else {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      ->max($columnName, $this);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return \in_array(str_replace('#__', $this->tablePrefix, $tableName), $this->getSchema()->getTableNames());
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function createTable($tableName, $columns)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var bool Enable caching database instance
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return self::$cache[$type];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              self::$cache[$type] = $db;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return self::$config[$type];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      + $conf['read_buffer_size'] + $conf['read_rnd_buffer_size'] + $conf['join_buffer_size'] + $conf['thread_stack'] + $conf['binlog_cache_size']));
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $return['size'] += $row['Data_length'] += $row['Index_length'];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return string the quoted SQL
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if ($bebugBar->hasCollector('pdo')) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $bebugBar->addCollector($pdoCollector);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return bool
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $dbType;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (isset(self::$cache[$type])) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Get info database server.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function getInfo()
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $conf = array_merge($conf, $statement->fetchAll(\PDO::FETCH_KEY_PAIR));
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'tables' => [],
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement = $this->getSlavePdo()->prepare("SHOW TABLE STATUS FROM `{$this->dbName}`");
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Line exceeds 120 characters; contains 147 characters
      Open

           * @param string $sequenceName name of the sequence object (required by some DBMS) ex. table vtiger_picklist >>> vtiger_picklist_picklistid_seq
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return PDO the pdo instance
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'id' => $id,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          private static $config = [];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $schemaCache = false;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  self::$config[$type] = Config::db($type) ?? Config::db('base');
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $typeDb = 'MariaDb';
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'serverVersion' => $version,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement->execute();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $return['dataSize'] += $row['Data_length'];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ++$id;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $id = (new \App\Db\Query())
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $id;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public static $connectCache = false;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var int Port database server
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public static function getConfig(string $type)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement->execute();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              [$version] = explode('-', $conf['version']);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      if (!empty($row['ALLOCATED_SIZE'])) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Also, the percentage character "%" at the beginning or ending of a table name will be replaced
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (Debuger::isDebugBar()) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $id = (new \App\Db\Query())->from($tableName)->scalar($this);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param mixed  $columns
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *           this may need to be set true so that PDO can emulate the prepare support to bypass
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'mssql' => 'yii\db\mssql\Schema', // older MSSQL driver on MS Windows hosts
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (!isset(self::$config[$type])) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              ($conf['innodb_additional_mem_pool_size'] ?? 0) + $conf['innodb_log_buffer_size'] + ($conf['max_connections'] * ($conf['sort_buffer_size']
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'connectionStatus' => $pdo->getAttribute(\PDO::ATTR_CONNECTION_STATUS),
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'rows' => $row['Rows'],
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'engine' => $row['Engine'],
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $statement->execute();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * The default implementation will create a PHP PDO instance.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Creating a new DB table.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *           the buggy native prepare support.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          private static $cache = [];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'mysql' => 'App\Db\Drivers\Mysql\Schema', // MySQL
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'sqlite2' => 'yii\db\sqlite\Schema', // sqlite 2
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'oci' => 'yii\db\oci\Schema', // Oracle driver
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @see enableSchemaCache
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $db;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Load database connection configuration.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Line exceeds 120 characters; contains 159 characters
      Open

                      + $conf['read_buffer_size'] + $conf['read_rnd_buffer_size'] + $conf['join_buffer_size'] + $conf['thread_stack'] + $conf['binlog_cache_size']));
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'clientVersion' => $pdo->getAttribute(\PDO::ATTR_CLIENT_VERSION),
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'format' => $row['Row_format'],
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $return['indexSize'] += $row['Index_length'];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $tableName = str_replace($this->dbName . '/', '', $row['NAME']);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $return['filesSize'] += $row['ALLOCATED_SIZE'];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Processes a SQL statement by quoting table and column names that are enclosed within double brackets.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Returns the ID of the last inserted row or sequence value.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $pdoCollector->addConnection($pdo, $this->dbType);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param false|string $columnName
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return bool
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->createCommand()->createTable($tableName, $columns, $tableOptions)->execute();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var string Database section
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Line exceeds 120 characters; contains 122 characters
      Open

           * @var string the class used to create new database [[Command]] objects. If you want to extend the [[Command]] class,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var Cache|string the cache object or the ID of the cache application component that
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $schemaMap = [
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'dblib' => 'yii\db\mssql\Schema', // dblib drivers on GNU/Linux (and maybe other OSes) hosts
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *             you may configure this property to use your extended version of the class
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement->execute();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $statement = $pdo->prepare('SELECT VERSION()');
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function getDbInfo(): array
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'dataSize' => 0,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'indexSize' => 0,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public static function setConfig($config, $type = 'base')
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'collation' => $row['Collation'],
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                              $return['tables'][$tableName]['fileSize'] = $row['ALLOCATED_SIZE'];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * You may override this method if the default PDO needs to be adapted for certain DBMS.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  } else {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Line exceeds 120 characters; contains 146 characters
      Open

              ($conf['innodb_additional_mem_pool_size'] ?? 0) + $conf['innodb_log_buffer_size'] + ($conf['max_connections'] * ($conf['sort_buffer_size']
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function getTableKeys($tableName)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'serverInfo' => $pdo->getAttribute(\PDO::ATTR_SERVER_INFO),
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return Cache::get('getTableKeys', $tableName);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } catch (\Throwable $th) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (!$this->isTableExists($tableName)) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $pdo = new Debug\DebugBar\TraceablePDO(parent::createPdoInstance());
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $pdoCollector = $bebugBar->getCollector('pdo');
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $tableName .= '_seq';
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $tableOptions = null;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ('mysql' === $this->getDriverName()) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $tableName = $this->quoteTableName(str_replace('#__', $this->tablePrefix, $tableName));
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public const DESC = 'DESC';
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $host;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'sqlsrv' => 'yii\db\mssql\Schema', // newer MSSQL driver on MS Windows hosts
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *                   is used to cache the table metadata
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $conf['version_comment'] = $conf['version_comment'] . '|' . $fullVersion;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'isFileSize' => false,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'dataSize' => $row['Data_length'],
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'indexSize' => $row['Index_length'],
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $return;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * with [[tablePrefix]].
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * This method is called by [[open]] to establish a DB connection.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param bool         $seq
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ])->execute();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Check if table is present in database.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *           will use the native prepare support if available. For some databases (such as MySQL),
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var \App\Db Table of connections with database
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $port;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $commandClass = '\App\Db\Command';
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $db->dbType = $type;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $type
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $fullVersion = $statement->fetch(\PDO::FETCH_COLUMN);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (false !== stripos($conf['version_comment'], 'MariaDb')) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Line exceeds 120 characters; contains 140 characters
      Open

              $memory = $conf['key_buffer_size'] + ($conf['query_cache_size'] ?? 0) + $conf['tmp_table_size'] + $conf['innodb_buffer_pool_size'] +
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'typeDb' => $typeDb,
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          if (isset($return['tables'][$tableName])) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                              $return['isFileSize'] = true;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $sql the SQL to be quoted
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function getLastInsertID($sequenceName = '')
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function getUniqueID($tableName, $columnName = false, $seq = true)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->createCommand()->update($tableName, [
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      ->from($tableName)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function isTableExists($tableName)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return [];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              ]);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              ];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $return['tables'][$row['Name']] = [
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $statement = $this->getSlavePdo()->prepare("SELECT * FROM `information_schema`.`INNODB_SYS_TABLESPACES` WHERE `NAME` LIKE '{$this->dbName}/%'");
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Line exceeds 120 characters; contains 156 characters
      Open

                  $statement = $this->getSlavePdo()->prepare("SELECT * FROM `information_schema`.`INNODB_SYS_TABLESPACES` WHERE `NAME` LIKE '{$this->dbName}/%'");
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function quoteSql($sql)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $pdoCollector = new \DebugBar\DataCollector\PDO\PDOCollector();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string       $tableName
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ($seq) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *           The default value is null, which means the PDO ATTR_EMULATE_PREPARES value will not be changed
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @var array Configuration with database
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /** {@inheritdoc} */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              'cubrid' => 'yii\db\cubrid\Schema', // CUBRID
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          ];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array with database configuration
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param array  $config
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $conf = $statement->fetchAll(\PDO::FETCH_KEY_PAIR);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'driver' => $this->getDriverName(),
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Get database info.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @see https://www.php.net/manual/en/function.PDO-lastInsertId.php
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return parent::getLastInsertID(str_replace('#__', $this->tablePrefix, $sequenceName));
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $pdoCollector->addConnection($pdo, $this->dbType);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ++$id;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $tableOptions = 'CHARACTER SET utf8 ENGINE=InnoDB';
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $key = isset($tableKeys['PRIMARY']) ? ['PRIMARY' => array_keys($tableKeys['PRIMARY'])] : [];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $key;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $keys;
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Get table primary keys.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $tableKeys = $this->getTableKeys($tableName);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * tokens enclosed within double square brackets are column names. They will be quoted accordingly.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Get table unique ID. Temporary function.
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (Cache::has('getTableKeys', $tableName)) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $key = [];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return type
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function getPrimaryKey($tableName)
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return Cache::get('getPrimaryKey', $tableName);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ('mysql' === $this->getDriverName()) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              Cache::save('getPrimaryKey', $tableName, $key, Cache::LONG);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  while ($row = $dataReader->read()) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              Cache::save('getTableKeys', $tableName, $keys, Cache::LONG);
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $keys = [];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ('mysql' === $this->getDriverName()) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $dataReader = $this->createCommand()->setSql('SHOW KEYS FROM ' . $tableName)->query();
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param type $tableName
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Line exceeds 120 characters; contains 140 characters
      Open

                      $keys[$row['Key_name']][$row['Column_name']] = ['columnName' => $row['Column_name'], 'unique' => empty($row['Non_unique'])];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (Cache::has('getPrimaryKey', $tableName)) {
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Tokens enclosed within double curly brackets are treated as table names, while
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return string the row ID of the last row inserted, or the last value retrieved from the sequence object
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          protected function createPdoInstance()
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $keys[$row['Key_name']][$row['Column_name']] = ['columnName' => $row['Column_name'], 'unique' => empty($row['Non_unique'])];
      Severity: Minor
      Found in app/Db.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status