YetiForceCompany/YetiForceCRM

View on GitHub
app/Db/Importer.php

Summary

Maintainability
F
1 wk
Test Coverage
F
13%

Function updateTables has a Cognitive Complexity of 150 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateTables(Base $importer)
    {
        $this->logs .= "> start update tables ({$importer->dbType})\n";
        $startMain = microtime(true);
        $schema = $importer->db->getSchema();
Severity: Minor
Found in app/Db/Importer.php - About 3 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File Importer.php has 658 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * File that imports structure and data to database.
 *
 * @package App
Severity: Major
Found in app/Db/Importer.php - About 1 day to fix

    Function addData has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        public function addData(Base $importer)
        {
            if (!isset($importer->data)) {
                return;
            }
    Severity: Minor
    Found in app/Db/Importer.php - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method updateTables has 154 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function updateTables(Base $importer)
        {
            $this->logs .= "> start update tables ({$importer->dbType})\n";
            $startMain = microtime(true);
            $schema = $importer->db->getSchema();
    Severity: Major
    Found in app/Db/Importer.php - About 6 hrs to fix

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

          public function addTables(Base $importer)
          {
              $this->logs .= "> start add tables ({$importer->dbType})\n";
              $startMain = microtime(true);
              foreach ($importer->tables as $tableName => $table) {
      Severity: Minor
      Found in app/Db/Importer.php - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      The class Importer has 22 public methods. Consider refactoring Importer to keep number of public methods under 10.
      Open

      class Importer
      {
          /**
           * End of line character.
           *
      Severity: Minor
      Found in app/Db/Importer.php by phpmd

      TooManyPublicMethods

      Since: 0.1

      A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      Example

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

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

      class Importer
      {
          /**
           * End of line character.
           *
      Severity: Minor
      Found in app/Db/Importer.php by phpmd

      Importer has 26 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Importer
      {
          /**
           * End of line character.
           *
      Severity: Minor
      Found in app/Db/Importer.php - About 3 hrs to fix

        Method addData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function addData(Base $importer)
            {
                if (!isset($importer->data)) {
                    return;
                }
        Severity: Major
        Found in app/Db/Importer.php - About 2 hrs to fix

          Method addTables has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function addTables(Base $importer)
              {
                  $this->logs .= "> start add tables ({$importer->dbType})\n";
                  $startMain = microtime(true);
                  foreach ($importer->tables as $tableName => $table) {
          Severity: Major
          Found in app/Db/Importer.php - About 2 hrs to fix

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

                public function updateForeignKey(Base $importer)
                {
                    if (!isset($importer->foreignKey)) {
                        return;
                    }
            Severity: Minor
            Found in app/Db/Importer.php - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                public function dropForeignKeys(array $foreignKeys)
                {
                    $this->logs .= "> start drop foreign keys\n";
                    $startMain = microtime(true);
                    $db = \App\Db::getInstance();
            Severity: Minor
            Found in app/Db/Importer.php - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                public function updateForeignKey(Base $importer)
                {
                    if (!isset($importer->foreignKey)) {
                        return;
                    }
            Severity: Minor
            Found in app/Db/Importer.php - About 1 hr to fix

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

                  public function dropIndexes(array $tables)
                  {
                      $this->logs .= "> start drop indexes\n";
                      $startMain = microtime(true);
                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in app/Db/Importer.php - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                  public function getIndexes(Base $importer, $table)
                  {
                      if (!isset($table['index'])) {
                          return false;
                      }
              Severity: Minor
              Found in app/Db/Importer.php - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function loadFiles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function loadFiles($path = false)
                  {
                      $dir = new \DirectoryIterator($path ?: $this->path);
                      foreach ($dir as $fileinfo) {
                          if ('dir' !== $fileinfo->getType() && 'php' === $fileinfo->getExtension()) {
              Severity: Minor
              Found in app/Db/Importer.php - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method dropForeignKeys has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function dropForeignKeys(array $foreignKeys)
                  {
                      $this->logs .= "> start drop foreign keys\n";
                      $startMain = microtime(true);
                      $db = \App\Db::getInstance();
              Severity: Minor
              Found in app/Db/Importer.php - About 1 hr to fix

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

                    public function renameColumns($columns)
                    {
                        $this->logs .= "> start rename columns\n";
                        $startMain = microtime(true);
                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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

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

                    public function renameTables($tables)
                    {
                        $this->logs .= "> start rename tables\n";
                        $startMain = microtime(true);
                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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

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

                    public function dropColumns($columns)
                    {
                        $this->logs .= "> start drop columns\n";
                        $startMain = microtime(true);
                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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

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

                    public function dropTable($tables)
                    {
                        $this->logs .= "> start drop tables\n";
                        $startMain = microtime(true);
                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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

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

                    public function addForeignKey(Base $importer)
                    {
                        if (!isset($importer->foreignKey)) {
                            return;
                        }
                Severity: Minor
                Found in app/Db/Importer.php - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                The method addData() has an NPath complexity of 640. The configured NPath complexity threshold is 200.
                Open

                    public function addData(Base $importer)
                    {
                        if (!isset($importer->data)) {
                            return;
                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

                NPathComplexity

                Since: 0.1

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

                Example

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

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

                The method updateTables() has an NPath complexity of 2057681. The configured NPath complexity threshold is 200.
                Open

                    public function updateTables(Base $importer)
                    {
                        $this->logs .= "> start update tables ({$importer->dbType})\n";
                        $startMain = microtime(true);
                        $schema = $importer->db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

                NPathComplexity

                Since: 0.1

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

                Example

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

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

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

                    public function updateTables(Base $importer)
                    {
                        $this->logs .= "> start update tables ({$importer->dbType})\n";
                        $startMain = microtime(true);
                        $schema = $importer->db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

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

                    public function addTables(Base $importer)
                    {
                        $this->logs .= "> start add tables ({$importer->dbType})\n";
                        $startMain = microtime(true);
                        foreach ($importer->tables as $tableName => $table) {
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

                CyclomaticComplexity

                Since: 0.1

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

                Example

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

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

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

                    public function addData(Base $importer)
                    {
                        if (!isset($importer->data)) {
                            return;
                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

                CyclomaticComplexity

                Since: 0.1

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

                Example

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

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

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

                    public function updateTables(Base $importer)
                    {
                        $this->logs .= "> start update tables ({$importer->dbType})\n";
                        $startMain = microtime(true);
                        $schema = $importer->db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

                CyclomaticComplexity

                Since: 0.1

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

                Example

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

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

                This function "updateTables" has 156 lines, which is greater than the 150 lines authorized. Split it into smaller functions.
                Open

                    public function updateTables(Base $importer)
                Severity: Major
                Found in app/Db/Importer.php by sonar-php

                A function that grows too large tends to aggregate too many responsibilities.

                Such functions inevitably become harder to understand and therefore harder to maintain.

                Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.

                Those smaller functions will not only be easier to understand, but also probably easier to test.

                Class "Importer" has 26 methods, which is greater than 20 authorized. Split it into smaller classes.
                Open

                class Importer
                Severity: Major
                Found in app/Db/Importer.php by sonar-php

                A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

                Refactor this function to reduce its Cognitive Complexity from 42 to the 15 allowed.
                Open

                    public function addData(Base $importer)
                Severity: Critical
                Found in app/Db/Importer.php by sonar-php

                Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                See

                Refactor this function to reduce its Cognitive Complexity from 39 to the 15 allowed.
                Open

                    public function addTables(Base $importer)
                Severity: Critical
                Found in app/Db/Importer.php by sonar-php

                Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                See

                Refactor this function to reduce its Cognitive Complexity from 175 to the 15 allowed.
                Open

                    public function updateTables(Base $importer)
                Severity: Critical
                Found in app/Db/Importer.php by sonar-php

                Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                See

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

                    public function loadFiles($path = false)
                Severity: Minor
                Found in app/Db/Importer.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 '350', column '15').
                Open

                                    if ((new \App\Db\Query())->from($tableName)->where(array_combine($keys, $table['values'][0]))->exists($importer->db)) {
                Severity: Minor
                Found in app/Db/Importer.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 '78', column '14').
                Open

                        $dir = new \DirectoryIterator($path ?: $this->path);
                Severity: Minor
                Found in app/Db/Importer.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 '366', column '16').
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '325', column '16').
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '394', column '17').
                Open

                                        throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '767', column '18').
                Open

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '204', column '18').
                Open

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '221', column '18').
                Open

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '797', column '19').
                Open

                                                throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '731', column '16').
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 logs has a boolean flag argument $show, which is a certain sign of a Single Responsibility Principle violation.
                Open

                    public function logs($show = true)
                Severity: Minor
                Found in app/Db/Importer.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 '400', column '17').
                Open

                                        throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 '189', column '16').
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.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 updateTables uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                } else {
                                    $tableSchema = $schema->getTableSchema($tableName);
                                    foreach ($this->getColumns($importer, $table) as $columnName => $column) {
                                        $renameFrom = $mode = null;
                                        if (\is_array($column)) {
                Severity: Minor
                Found in app/Db/Importer.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\Db' in method 'renameTables'.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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\Db' in method 'dropForeignKeys'.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 logs uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            file_put_contents('cache/logs/Importer.log', $this->logs . '-------------  ' . date('Y-m-d H:i:s') . " ($time min)   -------------\n", LOCK_EX);
                        }
                Severity: Minor
                Found in app/Db/Importer.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\Db' in method 'renameColumns'.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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\Db' in method 'dropIndexes'.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 assigning values to variables in if clauses and the like (line '734', column '8').
                Open

                    public function updateTables(Base $importer)
                    {
                        $this->logs .= "> start update tables ({$importer->dbType})\n";
                        $startMain = microtime(true);
                        $schema = $importer->db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

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

                Example

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

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

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

                                } else {
                                    $this->logs .= "| Error: No values\n";
                                }
                Severity: Minor
                Found in app/Db/Importer.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

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

                            } else {
                                $this->logs .= " | Error - table does not exist\n";
                            }
                Severity: Minor
                Found in app/Db/Importer.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

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

                            } else {
                                $this->logs .= " | Info - table does not exist\n";
                            }
                Severity: Minor
                Found in app/Db/Importer.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

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

                            } else {
                                $this->logs .= " | Error - table does not exists\n";
                            }
                Severity: Minor
                Found in app/Db/Importer.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\Db' in method 'dropColumns'.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 updateTables uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                        } else {
                                            $this->logs .= "  > create index: {$index[0]} ... ";
                                            $start = microtime(true);
                                            $dbCommand->createIndex($index[0], $tableName, $index[1], !empty($index[2]))->execute();
                                            $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.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

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

                                    } else {
                                        $start = microtime(true);
                                        foreach ($table['values'] as $values) {
                                            $importer->db->createCommand()->insert($tableName, array_combine($keys, $values))->execute();
                                        }
                Severity: Minor
                Found in app/Db/Importer.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

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

                            } else {
                                $this->logs .= " | Info - table or column does not exist\n";
                            }
                Severity: Minor
                Found in app/Db/Importer.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

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

                                } else {
                                    $this->logs .= " | Info - foreign key not exists\n";
                                }
                Severity: Minor
                Found in app/Db/Importer.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

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

                            } else {
                                $this->logs .= " | Warning - table or column does not exists\n";
                            }
                Severity: Minor
                Found in app/Db/Importer.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 assigning values to variables in if clauses and the like (line '192', column '8').
                Open

                    public function addTables(Base $importer)
                    {
                        $this->logs .= "> start add tables ({$importer->dbType})\n";
                        $startMain = microtime(true);
                        foreach ($importer->tables as $tableName => $table) {
                Severity: Minor
                Found in app/Db/Importer.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

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

                Example

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

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

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

                                } else {
                                    $this->logs .= " | Info - index not exists\n";
                                }
                Severity: Minor
                Found in app/Db/Importer.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\Db' in method 'dropTable'.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 updateTables uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                            } else {
                                                foreach ($dbIndexes[$index[0]] as $dbIndex) {
                                                    if (empty($index[2]) !== empty($dbIndex['unique'])) {
                                                        $update = true;
                                                    }
                Severity: Minor
                Found in app/Db/Importer.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

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

                        if (empty($table['columns'])) {
                Severity: Critical
                Found in app/Db/Importer.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 "Importer error: " 10 times.
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Critical
                Found in app/Db/Importer.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 "values" 4 times.
                Open

                                if (\is_array($table['values']) && isset($table['values'][0])) {
                Severity: Critical
                Found in app/Db/Importer.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 "Y-m-d H:i:s" 3 times.
                Open

                        $this->logs = '-------------   ' . date('Y-m-d H:i:s') . "   -------------\n";
                Severity: Critical
                Found in app/Db/Importer.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 "primaryKeys" 7 times.
                Open

                            if (isset($table['primaryKeys'])) {
                Severity: Critical
                Found in app/Db/Importer.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.

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

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

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

                        \App\Db::getInstance()->getSchema()->getTableSchemas('', true);
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                                        $importer->db->createCommand()->addPrimaryKey($primaryKey[0], $tableName, $primaryKey[1])->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $type = $importer->db->getDriverName();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                                $importer->db->createCommand()->createTable($tableName, $this->getColumns($importer, $table), $this->getOptions($importer, $table))->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $type = $importer->db->getDriverName();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Returning type false but getIndexes() is declared to return array
                Open

                            return false;
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                                        $importer->db->createCommand()->createIndex($index[0], $tableName, $index[1], (isset($index[2]) && $index[2]) ? true : false)->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

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

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

                                        $db->createCommand()->dropForeignKey($keyName, $tableName)->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $dbCommand = $db->createCommand();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Checking instanceof against undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                        if ($columnExists && $column instanceof \yii\db\ColumnSchemaBuilder && $this->compareColumns($queryBuilder, $tableSchema->columns[$columnName], $column)) {
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Reference to constant TYPE_BIGINT from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
                Open

                                                $column->set('type', \in_array($column->get('type'), ['ubigpk', 'bigpk']) ? \yii\db\Schema::TYPE_BIGINT : \yii\db\Schema::TYPE_INTEGER);
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $dbCommand = $importer->db->createCommand();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Returning type ?string but getOptions() is declared to return string
                Open

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

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

                                $importer->db->createCommand()->addForeignKey($key[0], $key[1], $key[2], $key[3], $key[4], $key[5] ?? null, $key[6] ?? null)->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                                    if ((new \App\Db\Query())->from($tableName)->where(array_combine($keys, $table['values'][0]))->exists($importer->db)) {
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                                            $importer->db->createCommand()->insert($tableName, array_combine($keys, $values))->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $dbCommand = $db->createCommand();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $schema = $db->getSchema();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Reference to instance property isUnsigned from undeclared class \yii\db\ColumnSchemaBuilder
                Open

                        || ($baseColumn->unsigned !== $targetColumn->isUnsigned)
                Severity: Minor
                Found in app/Db/Importer.php by phan

                Reference to instance property autoIncrement from undeclared class \yii\db\ColumnSchema
                Open

                        || ($baseColumn->autoIncrement !== $targetColumn->autoIncrement);
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                        $schema = $importer->db->getSchema();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Reference to constant TYPE_INTEGER from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
                Open

                                                $column->set('type', \in_array($column->get('type'), ['ubigpk', 'bigpk']) ? \yii\db\Schema::TYPE_BIGINT : \yii\db\Schema::TYPE_INTEGER);
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Checking instanceof against undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                        } elseif (!($column instanceof \yii\db\ColumnSchemaBuilder)) {
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                            $importer->db->createCommand()->checkIntegrity($check)->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Reference to instance property allowNull from undeclared class \yii\db\ColumnSchema
                Open

                        || ($baseColumn->allowNull !== (null === $targetColumn->isNotNull))
                Severity: Minor
                Found in app/Db/Importer.php by phan

                Reference to instance property defaultValue from undeclared class \yii\db\ColumnSchema
                Open

                        || ($baseColumn->defaultValue !== $targetColumn->default)
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                        $schema = $db->getSchema();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Call to method set from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                                $column->set('type', \in_array($column->get('type'), ['ubigpk', 'bigpk']) ? \yii\db\Schema::TYPE_BIGINT : \yii\db\Schema::TYPE_INTEGER);
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Reference to instance property autoIncrement from undeclared class \yii\db\ColumnSchemaBuilder
                Open

                        || ($baseColumn->autoIncrement !== $targetColumn->autoIncrement);
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                        $schema = $importer->db->getSchema();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Checking instanceof against undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                            if ($column instanceof \yii\db\ColumnSchemaBuilder && (\in_array($column->get('type'), ['upk', 'pk', 'ubigpk', 'bigpk']))) {
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                                    $db->createCommand()->dropTable($tableName)->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $dbCommand = $db->createCommand();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Call to method get from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                            if ($column instanceof \yii\db\ColumnSchemaBuilder && (\in_array($column->get('type'), ['upk', 'pk', 'ubigpk', 'bigpk']))) {
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Call to method get from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                                $column->set('type', \in_array($column->get('type'), ['ubigpk', 'bigpk']) ? \yii\db\Schema::TYPE_BIGINT : \yii\db\Schema::TYPE_INTEGER);
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Call to method getColumnType from undeclared class \yii\db\QueryBuilder
                Open

                        return strtok($baseColumn->dbType, ' ') !== strtok($queryBuilder->getColumnType($targetColumn), ' ')
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Reference to instance property default from undeclared class \yii\db\ColumnSchemaBuilder
                Open

                        || ($baseColumn->defaultValue !== $targetColumn->default)
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                            $tableSchema = $importer->db->getTableSchema($tableName);
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                                    $importer->db->createCommand()->resetSequence($tableName)->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

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

                        $dbCommand = $importer->db->createCommand();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Parameter $queryBuilder has undeclared type \yii\db\QueryBuilder
                Open

                    protected function compareColumns(\yii\db\QueryBuilder $queryBuilder, \yii\db\ColumnSchema $baseColumn, \yii\db\ColumnSchemaBuilder $targetColumn)
                Severity: Minor
                Found in app/Db/Importer.php by phan

                Reference to instance property dbType from undeclared class \yii\db\ColumnSchema
                Open

                        return strtok($baseColumn->dbType, ' ') !== strtok($queryBuilder->getColumnType($targetColumn), ' ')
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                            $tableSchema = $db->getTableSchema($tableName, true);
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Reference to instance property unsigned from undeclared class \yii\db\ColumnSchema
                Open

                        || ($baseColumn->unsigned !== $targetColumn->isUnsigned)
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                                        $db->createCommand()->dropIndex($index, $tableName)->execute();
                Severity: Critical
                Found in app/Db/Importer.php by phan

                Parameter $baseColumn has undeclared type \yii\db\ColumnSchema
                Open

                    protected function compareColumns(\yii\db\QueryBuilder $queryBuilder, \yii\db\ColumnSchema $baseColumn, \yii\db\ColumnSchemaBuilder $targetColumn)
                Severity: Minor
                Found in app/Db/Importer.php by phan

                Parameter $targetColumn has undeclared type \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                    protected function compareColumns(\yii\db\QueryBuilder $queryBuilder, \yii\db\ColumnSchema $baseColumn, \yii\db\ColumnSchemaBuilder $targetColumn)
                Severity: Minor
                Found in app/Db/Importer.php by phan

                Reference to instance property isNotNull from undeclared class \yii\db\ColumnSchemaBuilder
                Open

                        || ($baseColumn->allowNull !== (null === $targetColumn->isNotNull))
                Severity: Minor
                Found in app/Db/Importer.php by phan

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

                            if ($db->isTableExists($table[0])) {
                                $start = microtime(true);
                                try {
                                    $dbCommand->renameTable($table[0], $table[1])->execute();
                                    $time = round((microtime(true) - $start), 1);
                Severity: Major
                Found in app/Db/Importer.php and 1 other location - About 3 hrs to fix
                app/Db/Importer.php on lines 625..637

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                            if ($tableSchema && isset($tableSchema->columns[$column[1]])) {
                                $start = microtime(true);
                                try {
                                    $dbCommand->dropColumn($column[0], $column[1])->execute();
                                    $time = round((microtime(true) - $start), 1);
                Severity: Major
                Found in app/Db/Importer.php and 1 other location - About 3 hrs to fix
                app/Db/Importer.php on lines 427..441

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                if (isset($dbIndexes[$index])) {
                                    $start = microtime(true);
                                    try {
                                        $db->createCommand()->dropIndex($index, $tableName)->execute();
                                        $time = round((microtime(true) - $start), 1);
                Severity: Major
                Found in app/Db/Importer.php and 1 other location - About 3 hrs to fix
                app/Db/Importer.php on lines 528..540

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 144.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                if (isset($tableSchema->foreignKeys[$keyName])) {
                                    $start = microtime(true);
                                    try {
                                        $db->createCommand()->dropForeignKey($keyName, $tableName)->execute();
                                        $time = round((microtime(true) - $start), 1);
                Severity: Major
                Found in app/Db/Importer.php and 1 other location - About 3 hrs to fix
                app/Db/Importer.php on lines 494..506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 144.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                            try {
                                $importer->db->createCommand()->createTable($tableName, $this->getColumns($importer, $table), $this->getOptions($importer, $table))->execute();
                                $time = round((microtime(true) - $start), 1);
                                $this->logs .= "done    ({$time}s)\n";
                            } catch (\Throwable $e) {
                Severity: Major
                Found in app/Db/Importer.php and 5 other locations - About 50 mins to fix
                app/Db/Importer.php on lines 196..206
                app/Db/Importer.php on lines 213..223
                app/Db/Importer.php on lines 317..327
                app/Db/Importer.php on lines 386..396
                app/Db/Importer.php on lines 784..799

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                    try {
                                        $importer->db->createCommand()->createIndex($index[0], $tableName, $index[1], (isset($index[2]) && $index[2]) ? true : false)->execute();
                                        $time = round((microtime(true) - $start), 1);
                                        $this->logs .= "done    ({$time}s)\n";
                                    } catch (\Throwable $e) {
                Severity: Major
                Found in app/Db/Importer.php and 5 other locations - About 50 mins to fix
                app/Db/Importer.php on lines 181..191
                app/Db/Importer.php on lines 213..223
                app/Db/Importer.php on lines 317..327
                app/Db/Importer.php on lines 386..396
                app/Db/Importer.php on lines 784..799

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                    try {
                                        $importer->db->createCommand()->addPrimaryKey($primaryKey[0], $tableName, $primaryKey[1])->execute();
                                        $time = round((microtime(true) - $start), 1);
                                        $this->logs .= "done    ({$time}s)\n";
                                    } catch (\Throwable $e) {
                Severity: Major
                Found in app/Db/Importer.php and 5 other locations - About 50 mins to fix
                app/Db/Importer.php on lines 181..191
                app/Db/Importer.php on lines 196..206
                app/Db/Importer.php on lines 317..327
                app/Db/Importer.php on lines 386..396
                app/Db/Importer.php on lines 784..799

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                try {
                                    $importer->db->createCommand()->resetSequence($tableName)->execute();
                                    $time = round((microtime(true) - $start), 1);
                                    $this->logs .= "done    ({$time}s)\n";
                                } catch (\Throwable $e) {
                Severity: Major
                Found in app/Db/Importer.php and 5 other locations - About 50 mins to fix
                app/Db/Importer.php on lines 181..191
                app/Db/Importer.php on lines 196..206
                app/Db/Importer.php on lines 213..223
                app/Db/Importer.php on lines 317..327
                app/Db/Importer.php on lines 784..799

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                        try {
                                            if (isset($dbPrimaryKeys[$primaryKey[0]])) {
                                                $dbCommand->dropPrimaryKey($primaryKey[0], $tableName)->execute();
                                            } elseif ($dbPrimaryKeys) {
                                                $dbCommand->dropPrimaryKey(key($dbPrimaryKeys), $tableName)->execute();
                Severity: Major
                Found in app/Db/Importer.php and 5 other locations - About 50 mins to fix
                app/Db/Importer.php on lines 181..191
                app/Db/Importer.php on lines 196..206
                app/Db/Importer.php on lines 213..223
                app/Db/Importer.php on lines 317..327
                app/Db/Importer.php on lines 386..396

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                            try {
                                $importer->db->createCommand()->addForeignKey($key[0], $key[1], $key[2], $key[3], $key[4], $key[5] ?? null, $key[6] ?? null)->execute();
                                $time = round((microtime(true) - $start), 1);
                                $this->logs .= "done    ({$time}s)\n";
                            } catch (\Throwable $e) {
                Severity: Major
                Found in app/Db/Importer.php and 5 other locations - About 50 mins to fix
                app/Db/Importer.php on lines 181..191
                app/Db/Importer.php on lines 196..206
                app/Db/Importer.php on lines 213..223
                app/Db/Importer.php on lines 386..396
                app/Db/Importer.php on lines 784..799

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 $db. Configured minimum length is 3.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 $db. Configured minimum length is 3.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 $db. Configured minimum length is 3.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 $db. Configured minimum length is 3.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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 $db. Configured minimum length is 3.
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.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

                     * End of line character.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     * @var string|float
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     * Array with objects to import.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                require $fileinfo->getPath() . \DIRECTORY_SEPARATOR . $fileinfo->getFilename();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                            $this->addTables($importer);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        foreach ($this->importers as &$importer) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

                Line exceeds 120 characters; contains 131 characters
                Open

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                                    $instance->scheme();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

                Line exceeds 120 characters; contains 156 characters
                Open

                            file_put_contents('cache/logs/Importer.log', $this->logs . '-------------  ' . date('Y-m-d H:i:s') . " ($time min)   -------------\n", LOCK_EX);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        foreach ($this->importers as &$importer) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        foreach ($this->importers as &$importer) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                     * @param Base $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        foreach ($importer->tables as $tableName => $table) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $importer->db->createCommand()->createTable($tableName, $this->getColumns($importer, $table), $this->getOptions($importer, $table))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 161 characters
                Open

                                        $importer->db->createCommand()->createIndex($index[0], $tableName, $index[1], (isset($index[2]) && $index[2]) ? true : false)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 131 characters
                Open

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $this->logs .= "  > add primary key: {$primaryKey[0]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * Path to the directory with files to import.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                     * Import database structure.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            $this->addForeignKey($importer);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                    private $startTime;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        $this->logs = '-------------   ' . date('Y-m-d H:i:s') . "   -------------\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $dir = new \DirectoryIterator($path ?: $this->path);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        foreach ($this->importers as &$importer) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $this->logs .= "    ({$time}s) | Error(2) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        $this->logs .= "# end add tables ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $className = 'Importers\\' . $fileinfo->getBasename('.php');
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $this->importers[] = $instance;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                            $this->logs .= "  > add table: $tableName ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                    $this->logs .= "  > create index: {$index[0]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        foreach ($dir as $fileinfo) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            echo $this->logs . '---------  ' . date('Y-m-d H:i:s') . "  ($time min)  -------------\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                     * Import database rows.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        foreach ($this->importers as &$importer) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 159 characters
                Open

                                $importer->db->createCommand()->createTable($tableName, $this->getColumns($importer, $table), $this->getOptions($importer, $table))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            if (isset($table['primaryKeys'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    $instance->data();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                    public function logs($show = true)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     * Post Process action.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $importer->db->createCommand()->createIndex($index[0], $tableName, $index[1], (isset($index[2]) && $index[2]) ? true : false)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $importer->db->createCommand()->addPrimaryKey($primaryKey[0], $tableName, $primaryKey[1])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                     * @var Base[]
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     * Load all files for import.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            if ('dir' !== $fileinfo->getType() && 'php' === $fileinfo->getExtension()) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                if (method_exists($instance, 'data')) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                            $this->drop($importer);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

                Line exceeds 120 characters; contains 125 characters
                Open

                                        $this->logs .= "    ({$time}s) | Error(2) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param bool|string $path
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                     * Update db scheme.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $this->logs .= "    ({$time}s) | Error(1) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                foreach ($indexes as $index) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                    public $path = 'install/install_schema';
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                if (method_exists($instance, 'scheme')) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            $this->updateTables($importer);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                                $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                     * Check redundant tables.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $instance = new $className();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     * Refresh db schema.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            file_put_contents('cache/logs/Importer.log', $this->logs . '-------------  ' . date('Y-m-d H:i:s') . " ($time min)   -------------\n", LOCK_EX);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                            $this->updateForeignKey($importer);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                    public function addTables(Base $importer)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $this->logs .= "    ({$time}s) | Error(3) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 125 characters
                Open

                                        $this->logs .= "    ({$time}s) | Error(3) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                     * Stop import if an error occurs.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        $this->startTime = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \App\Db::getInstance()->getSchema()->getTableSchemas('', true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        $this->logs .= "> start add tables ({$importer->dbType})\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 123 characters
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            if ($indexes = $this->getIndexes($importer, $table)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                     * Post Process action.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                    public function loadFiles($path = false)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                     * Show or save logs.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $time = round((microtime(true) - $this->startTime) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                                foreach ($table['primaryKeys'] as $primaryKey) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 125 characters
                Open

                                        $importer->db->createCommand()->addPrimaryKey($primaryKey[0], $tableName, $primaryKey[1])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            $this->addData($importer);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * Creates a SQL command for adding a foreign key constraint to an existing table.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        foreach ($importer->foreignKey as $key) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                            foreach ($table['columns_' . $type] as $column => $customType) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $columns[$column] = $customType;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        if (!isset($importer->data)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                    public function getColumns(Base $importer, $table)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        if (empty($table['columns'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        if (isset($table['columns_' . $type])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            $this->logs .= "  > add data to table: $tableName ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                     * @param Base  $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $indexes = $table['index'];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                foreach ($indexes as $key => $index) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                    public function addForeignKey(Base $importer)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "> start reset sequence\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $isAutoIncrement = true;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     * Get index to create.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $this->logs .= "    > custom index, driver: $type, type: {$customIndex['0']} \n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        foreach ($importer->data as $tableName => $table) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                if ($column->autoIncrement) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param array $table
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                    public function getOptions(Base $importer, $table)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        $type = $importer->db->getDriverName();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $importer->db->createCommand()->addForeignKey($key[0], $key[1], $key[2], $key[3], $key[4], $key[5] ?? null, $key[6] ?? null)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 152 characters
                Open

                                $importer->db->createCommand()->addForeignKey($key[0], $key[1], $key[2], $key[3], $key[4], $key[5] ?? null, $key[6] ?? null)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $keys = $table['columns'];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    if ((new \App\Db\Query())->from($tableName)->where(array_combine($keys, $table['values'][0]))->exists($importer->db)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * Get columns to create.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param Base  $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param array $table
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "> start add foreign key ({$importer->dbType})\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "# end add foreign key ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            if (isset($table['collate'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        if (!isset($importer->foreignKey)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 123 characters
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param Base $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                                $options .= " COLLATE={$table['collate']}";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $type = $importer->db->getDriverName();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $this->logs .= "    ({$time}s) | Error(4) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                    public function addData(Base $importer)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                    $this->logs .= "| Error: No values\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     * Get additional SQL fragment that will be appended to the generated SQL.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            $options = "ENGINE={$table['engine']} DEFAULT CHARSET={$table['charset']}";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                                    if ($customIndex[0] === $index[0]) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        $indexes[$key] = $customIndex;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            foreach ($tableSchema->columns as $column) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

                Line exceeds 120 characters; contains 139 characters
                Open

                                    if ((new \App\Db\Query())->from($tableName)->where(array_combine($keys, $table['values'][0]))->exists($importer->db)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 123 characters
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "# end add data rows ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        $columns = $table['columns'];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param Base $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        $this->logs .= "> start add data rows ({$importer->dbType})\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                            $this->logs .= "  > add: {$key[0]}, {$key[1]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                            $importer->db->createCommand()->insert($tableName, array_combine($keys, $values))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param Base  $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if (\is_array($table['values']) && isset($table['values'][0])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                        foreach ($table['values'] as $values) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            $tableSchema = $importer->db->getTableSchema($tableName);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                     * @param array $table
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                        if (!isset($table['index'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        if (isset($table['index_' . $type])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            foreach ($table['index_' . $type] as $customIndex) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                $this->logs .= " | Error(5) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                    public function getIndexes(Base $importer, $table)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

                                        $this->logs .= "| Info: skipped because it exist first row\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 121 characters
                Open

                                            $importer->db->createCommand()->insert($tableName, array_combine($keys, $values))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        foreach ($importer->data as $tableName => $table) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

                Line exceeds 120 characters; contains 127 characters
                Open

                                        throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                    public function renameTables($tables)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 121 characters
                Open

                                    $this->logs .= "    ({$time}s) | Error(11) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $this->logs .= "  > reset sequence: $tableName ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param array $tables
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "> start rename tables\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $dbCommand = $db->createCommand();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            $this->logs .= "  > drop table, {$tableName} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                    $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 121 characters
                Open

                                    $this->logs .= "    ({$time}s) | Error(12) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $this->logs .= "  > drop index, {$tableName}:{$index} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                    $this->logs .= " | Info - index not exists\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                    public function dropForeignKeys(array $foreignKeys)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                            $this->logs .= "  > rename table, {$table[0]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            if ($db->isTableExists($table[0])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "> start drop tables\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $db->createCommand()->dropTable($tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                    public function dropTable($tables)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        if (\is_string($tables)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        $this->logs .= "# end reset sequence ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param array|string $tables
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 125 characters
                Open

                                        $this->logs .= "    ({$time}s) | Error(12) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "> start drop foreign keys\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                if (isset($tableSchema->foreignKeys[$keyName])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $importer->db->createCommand()->resetSequence($tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                $this->logs .= " | Info - table {$table[1]} is exists\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "# end drop tables ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                    public function dropIndexes(array $tables)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "> start drop indexes\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                        $this->logs .= "# end rename tables ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        foreach ($foreignKeys as $keyName => $tableName) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            $tableSchema = $db->getTableSchema($tableName, true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                     *        ['oldName', 'newName']
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $dbCommand->renameTable($table[0], $table[1])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            foreach ($indexes as $index) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                     * $tables = [
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        $this->logs .= "# end drop indexes ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                        foreach ($tables as $table) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            $tables = [$tables];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $this->logs .= "    ({$time}s) | Error(12) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                            $dbIndexes = $db->getTableKeys($tableName);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 127 characters
                Open

                                        throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $this->logs .= "    ({$time}s) | Error(11) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                            } elseif ($db->isTableExists($table[1])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                        foreach ($tables as $tableName) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

                                if (isset($dbIndexes[$index])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                                    $this->logs .= "    ({$time}s) | Error(6) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                    $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                    $this->logs .= "   > Error: redundant table {$tableName}_seq !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     * @param array $tables [$table=>[$index,...],...]
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                $this->logs .= " | Error - table does not exist\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

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

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

                                        $db->createCommand()->dropIndex($index, $tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                     *        ['u_#__mail_address_boock', 'u_#__mail_address_book']
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

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

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Drop foreign keys.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param array $foreignKeys [$foreignKey=>table,...]
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $this->logs .= "  > drop foreign key, {$tableName}:{$keyName} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 121 characters
                Open

                                    $this->logs .= "    ({$time}s) | Error(6) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                if ($this->redundantTables && isset($importer->data[$tableName . '_seq'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $this->logs .= " | Info - table does not exist\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($tables as $tableName => $indexes) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $this->logs .= "    ({$time}s) | Error(12) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    try {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param array $columns
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $dbCommand = $db->createCommand();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($columns as $column) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                try {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                } catch (\Throwable $e) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param array $columns
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function dropColumns($columns)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $columnExists = isset($tableSchema->columns[$columnName]);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= " | Info - foreign key not exists\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $this->logs .= "    ({$time}s) | Error [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Rename columns.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (isset($importer->dropIndexes)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $schema = $db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $column = $column['type'] ?? '';
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if ($tableSchema && isset($tableSchema->columns[$column[1]])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Update tables structure.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($importer->tables as $tableName => $table) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "  > add table: $tableName ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        if ($renameFrom && !$columnExists && isset($tableSchema->columns[$renameFrom])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 121 characters
                Open

                                        $this->logs .= "    ({$time}s) | Error [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "> start rename columns\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if ($tableSchema && isset($tableSchema->columns[$column[1]]) && !isset($tableSchema->columns[$column[2]])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 121 characters
                Open

                                    $this->logs .= "    ({$time}s) | Error(13) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 121 characters
                Open

                                    $this->logs .= "    ({$time}s) | Error(14) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param Base $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 143 characters
                Open

                                    $dbCommand->createTable($tableName, $this->getColumns($importer, $table), $this->getOptions($importer, $table))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    } catch (\Throwable $e) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $dbCommand->renameColumn($column[0], $column[1], $column[2])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "    ({$time}s) | Error(13) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param Base $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * ];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        if (\is_array($column)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * $columns = [
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "# end rename columns ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function drop(Base $importer)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $this->dropColumns($importer->dropColumns);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $this->logs .= " | Info - table or column does not exist\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    foreach ($this->getColumns($importer, $table) as $columnName => $column) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $this->dropTable($importer->dropTables);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Drop columns.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *        ['TableName', 'columnName'],
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "> start drop columns\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * $columns = [
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @throws \App\Exceptions\AppException
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $tableSchema = $schema->getTableSchema($tableName);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $db->createCommand()->dropForeignKey($keyName, $tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $this->logs .= " | Error - table does not exists\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $dbCommand = $db->createCommand();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $schema = $db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $schema = $importer->db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $queryBuilder = $schema->getQueryBuilder();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $renameFrom = $mode = null;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $renameFrom = $column['renameFrom'] ?? '';
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $dbCommand->renameColumn($tableName, $renameFrom, $columnName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "# end drop foreign keys ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function renameColumns($columns)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $this->dropIndexes($importer->dropIndexes);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *        ['vtiger_smsnotifier', 'status'],
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $dbCommand->dropColumn($column[0], $column[1])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "> start update tables ({$importer->dbType})\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            try {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $mode = $column['mode'] ?? $mode; // 0,null - create/update, 1 - update only
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *        ['TableName', 'oldName', 'newName'],
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *        ['vtiger_smsnotifier', 'status', 'smsnotifier_status'],
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (isset($importer->dropTables)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (isset($importer->dropColumns)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($columns as $column) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "    ({$time}s) | Error(14) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "# end drop columns ($time min)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function updateTables(Base $importer)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $dbCommand->createTable($tableName, $this->getColumns($importer, $table), $this->getOptions($importer, $table))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $tableSchema = $schema->getTableSchema($column[0]);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $tableSchema = $schema->getTableSchema($column[0]);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                try {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                } catch (\Throwable $e) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $this->logs .= "  > rename column: {$column[0]}:{$column[1]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $this->logs .= " | Warning - table or column does not exists\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $this->logs .= "  > drop column: {$column[0]}:{$column[1]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                if (!$importer->db->isTableExists($tableName)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * ];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Drop tables and columns.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $db = \App\Db::getInstance();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $dbCommand = $importer->db->createCommand();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "  > rename column: {$tableName}:{$renameFrom} -> {$columnName}... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "  > Warning: column ({$tableName}:{$columnName}) is not verified\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            if ($update) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 174 characters
                Open

                                        if (\is_string($primaryKey[1]) ? !(1 !== \count($dbPrimaryKey) && $primaryKey[1] !== $dbPrimaryKey[0]) : !array_diff($primaryKey[1], $dbPrimaryKey)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $this->logs .= " | Error(7) {$tableName} [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    try {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $dbCommand->dropPrimaryKey($primaryKey[0], $tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            if ($this->dieOnError) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        } elseif (!($column instanceof \yii\db\ColumnSchemaBuilder)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        if (isset($dbIndexes[$index[0]])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 158 characters
                Open

                                            if (\is_string($index[1]) ? !isset($dbIndexes[$index[0]][$index[1]]) : array_diff($index[1], array_keys($dbIndexes[$index[0]]))) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $status = false;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $column->set('type', \in_array($column->get('type'), ['ubigpk', 'bigpk']) ? \yii\db\Schema::TYPE_BIGINT : \yii\db\Schema::TYPE_INTEGER);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 154 characters
                Open

                                                    $importer->foreignKey[] = [$keyName, $sourceTableName, $fk['sourceColumn'], $tableName, $columnName, 'CASCADE', null];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $dbCommand->addPrimaryKey($primaryKey[0], $tableName, $primaryKey[1])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $tableSchema = $schema->getTableSchema($tableName, true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                        $this->logs .= "  > foreign key must be removed and added in postUpdate: $tableName:$columnName <> {$value[0]}:{$value[$columnName]} FK:{$keyName}\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                        $importer->foreignKey[] = [$keyName, $tableName, $columnName, $value[0], $value[$columnName], 'CASCADE', null];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if ($indexes = $this->getIndexes($importer, $table)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $dbIndexes = $importer->db->getTableKeys($tableName);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $update = false;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 201 characters
                Open

                                        $this->logs .= "  > update primary key: {$primaryKey[0]} , table: $tableName , column: " . (\is_array($primaryKey[1]) ? implode(',', $primaryKey[1]) : $primaryKey[1]) . ' ... ';
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }elseif (!$columnExists && 1 !== $mode) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "  > add column: $tableName:$columnName ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    if (isset($value[$columnName])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $update = true;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $this->logs .= "  > update index: {$index[0]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "  > create index: {$index[0]} ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 131 characters
                Open

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $dbCommand->dropPrimaryKey(key($dbPrimaryKeys), $tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "    ({$time}s) | Error(10) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 190 characters
                Open

                                                        $this->logs .= "  > foreign key must be removed and added in postUpdate: $tableName:$columnName <> {$value[0]}:{$value[$columnName]} FK:{$keyName}\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $dbCommand->alterColumn($tableName, $columnName, $column)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $dbCommand->createIndex($index[0], $tableName, $index[1], !empty($index[2]))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if (isset($table['primaryKeys'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        if (\is_string($primaryKey[1]) ? !(1 !== \count($dbPrimaryKey) && $primaryKey[1] !== $dbPrimaryKey[0]) : !array_diff($primaryKey[1], $dbPrimaryKey)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $dbCommand->addColumn($tableName, $columnName, $column)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 152 characters
                Open

                                            if ($column instanceof \yii\db\ColumnSchemaBuilder && (\in_array($column->get('type'), ['upk', 'pk', 'ubigpk', 'bigpk']))) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 151 characters
                Open

                                                        $importer->foreignKey[] = [$keyName, $tableName, $columnName, $value[0], $value[$columnName], 'CASCADE', null];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                if (!isset($table['primaryKeys'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $table['primaryKeys'][] = [$tableSchema->fullName . '_pk', [$columnName]];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                if ($this->dieOnError) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                foreach ($dbIndexes[$index[0]] as $dbIndex) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                        $update = true;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $status = true;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    if ($status) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        } catch (\Throwable $e) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param \yii\db\ColumnSchemaBuilder $targetColumn
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        if ($columnExists && $column instanceof \yii\db\ColumnSchemaBuilder && $this->compareColumns($queryBuilder, $tableSchema->columns[$columnName], $column)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 123 characters
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    $importer->foreignKey[] = [$keyName, $sourceTableName, $fk['sourceColumn'], $tableName, $columnName, 'CASCADE', null];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    foreach ($dbPrimaryKeys as $dbPrimaryKey) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $this->logs .= "  > update primary key: {$primaryKey[0]} , table: $tableName , column: " . (\is_array($primaryKey[1]) ? implode(',', $primaryKey[1]) : $primaryKey[1]) . ' ... ';
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 179 characters
                Open

                                        if ($columnExists && $column instanceof \yii\db\ColumnSchemaBuilder && $this->compareColumns($queryBuilder, $tableSchema->columns[$columnName], $column)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            if ($column instanceof \yii\db\ColumnSchemaBuilder && (\in_array($column->get('type'), ['upk', 'pk', 'ubigpk', 'bigpk']))) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            foreach ($schema->findForeignKeyToColumn($tableName, $columnName) as $sourceTableName => $fks) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    $table['primaryKeys'] = [];
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $dbCommand->dropIndex($index[0], $tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $primaryKey = false;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $dbPrimaryKeys = $importer->db->getPrimaryKey($tableName);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                foreach ($table['primaryKeys'] as $primaryKey) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $primaryKey = true;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Compare two columns if they are identical.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            if ($tableSchema->foreignKeys) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                foreach ($fks as $keyName => $fk) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 191 characters
                Open

                                                    $this->logs .= "  > foreign key must be removed and added in postUpdate: $tableName:$columnName <> $sourceTableName:{$fk['sourceColumn']} FK:{$keyName}\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            } catch (\Throwable $e) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        $this->logs .= " | Error(8) [{$e->getMessage()}] in  \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param \yii\db\QueryBuilder        $queryBuilder
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 168 characters
                Open

                                                $column->set('type', \in_array($column->get('type'), ['ubigpk', 'bigpk']) ? \yii\db\Schema::TYPE_BIGINT : \yii\db\Schema::TYPE_INTEGER);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            if ($primaryKey) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    if (empty($index[2]) !== empty($dbIndex['unique'])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        if ($this->dieOnError) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            if (isset($dbPrimaryKeys[$primaryKey[0]])) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 135 characters
                Open

                                                throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param \yii\db\ColumnSchema        $baseColumn
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $columnExists = isset($tableSchema->columns[$columnName]);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                        $dbCommand->dropForeignKey($keyName, $tableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 124 characters
                Open

                                            foreach ($schema->findForeignKeyToColumn($tableName, $columnName) as $sourceTableName => $fks) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    throw new \App\Exceptions\AppException('Importer error: ' . $e->getMessage(), (int) $e->getCode(), $e);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                foreach ($indexes as $index) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    } catch (\Throwable $e) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            } elseif ($dbPrimaryKeys) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                foreach ($tableSchema->foreignKeys as $keyName => $value) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    $this->logs .= "  > foreign key must be removed and added in postUpdate: $tableName:$columnName <> $sourceTableName:{$fk['sourceColumn']} FK:{$keyName}\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                    $dbCommand->dropForeignKey($keyName, $sourceTableName)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $this->logs .= "  > alter column: $tableName:$columnName ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            if (\is_string($index[1]) ? !isset($dbIndexes[$index[0]][$index[1]]) : array_diff($index[1], array_keys($dbIndexes[$index[0]]))) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "# end update tables    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                                $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        } else {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $dbCommand->createIndex($index[0], $tableName, $index[1], !empty($index[2]))->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        try {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 129 characters
                Open

                                            $this->logs .= "    ({$time}s) | Error(10) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $dbCommand = $importer->db->createCommand();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "     ({$time}s) | Error(10) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $destTableName = $importer->db->quoteSql($key[3]);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 137 characters
                Open

                                    $dbCommand->addForeignKey($keyName, $sourceTableName, $key[2], $destTableName, $key[4], $key[5], $key[6])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                } catch (\Throwable $e) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Update a foreign key constraint to an existing table.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function checkIntegrity($check)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        || ($baseColumn->autoIncrement !== $targetColumn->autoIncrement);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function updateForeignKey(Base $importer)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (!isset($importer->foreignKey)) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $add = true;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if ($add) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $this->logs .= "  > add: $keyName, $sourceTableName ... ";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 150 characters
                Open

                    protected function compareColumns(\yii\db\QueryBuilder $queryBuilder, \yii\db\ColumnSchema $baseColumn, \yii\db\ColumnSchemaBuilder $targetColumn)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param Base $importer
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $this->logs .= "done    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 122 characters
                Open

                                    $this->logs .= "     ({$time}s) | Error(10) [{$e->getMessage()}] in \n{$e->getTraceAsString()} !!!\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            foreach ($tableSchema->foreignKeys as $dbForeignKey) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        || ($baseColumn->unsigned !== $targetColumn->isUnsigned)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Line exceeds 120 characters; contains 129 characters
                Open

                                if ($destTableName === $dbForeignKey[0] && isset($dbForeignKey[$key[2]]) && $key[4] === $dbForeignKey[$key[2]]) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $add = false;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        || ($baseColumn->allowNull !== (null === $targetColumn->isNotNull))
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param bool $check whether to turn on or off the integrity check.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        || ($baseColumn->defaultValue !== $targetColumn->default)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $schema = $importer->db->getSchema();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $start = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $dbCommand->addForeignKey($keyName, $sourceTableName, $key[2], $destTableName, $key[4], $key[5], $key[6])->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $keyName = $importer->db->quoteSql($key[0]);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                try {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return strtok($baseColumn->dbType, ' ') !== strtok($queryBuilder->getColumnType($targetColumn), ' ')
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $sourceTableName = $importer->db->quoteSql($key[1]);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                if ($destTableName === $dbForeignKey[0] && isset($dbForeignKey[$key[2]]) && $key[4] === $dbForeignKey[$key[2]]) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $time = round((microtime(true) - $startMain) / 60, 2);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "# end update foreign key    ({$time}s)\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($this->importers as &$importer) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $time = round((microtime(true) - $start), 1);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Builds a SQL command for enabling or disabling integrity check.
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $this->logs .= "> start update foreign key ({$importer->dbType})\n";
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $startMain = microtime(true);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($importer->foreignKey as $key) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return void
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    protected function compareColumns(\yii\db\QueryBuilder $queryBuilder, \yii\db\ColumnSchema $baseColumn, \yii\db\ColumnSchemaBuilder $targetColumn)
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            return;
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $tableSchema = $schema->getTableSchema($sourceTableName);
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $importer->db->createCommand()->checkIntegrity($check)->execute();
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                Expected 1 space after closing brace; 0 found
                Open

                                        }elseif (!$columnExists && 1 !== $mode) {
                Severity: Minor
                Found in app/Db/Importer.php by phpcodesniffer

                There are no issues that match your filters.

                Category
                Status