YetiForceCompany/YetiForceCRM

View on GitHub
app/Db/Fixer.php

Summary

Maintainability
D
2 days
Test Coverage
B
80%

Function maximumFieldsLength has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

    public static function maximumFieldsLength(array $conditions = []): array
    {
        $typesNotSupported = ['datetime', 'date', 'year', 'timestamp', 'time'];
        $uiTypeNotSupported = [30];
        $updated = $requiresVerification = $typeNotFound = $notSupported = 0;
Severity: Minor
Found in app/Db/Fixer.php - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

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

    public static function baseModuleTools(): int
    {
        $i = 0;
        $allUtility = $missing = $curentProfile2utility = [];
        foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
Severity: Minor
Found in app/Db/Fixer.php - About 5 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Method maximumFieldsLength has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function maximumFieldsLength(array $conditions = []): array
    {
        $typesNotSupported = ['datetime', 'date', 'year', 'timestamp', 'time'];
        $uiTypeNotSupported = [30];
        $updated = $requiresVerification = $typeNotFound = $notSupported = 0;
Severity: Major
Found in app/Db/Fixer.php - About 3 hrs to fix

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

    class Fixer
    {
        /**
         * Add missing entries in vtiger_profile2field.
         */
    Severity: Minor
    Found in app/Db/Fixer.php by phpmd

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

        public static function baseModuleTools(): int
        {
            $i = 0;
            $allUtility = $missing = $curentProfile2utility = [];
            foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
    Severity: Minor
    Found in app/Db/Fixer.php - About 1 hr to fix

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

          public static function baseModuleActions(): int
          {
              $i = 0;
              $curentProfile = [];
              foreach ((new \App\Db\Query())->from('vtiger_profile2standardpermissions')->all() as $row) {
      Severity: Minor
      Found in app/Db/Fixer.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 profileField has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function profileField(): int
          {
              \App\Log::trace('Entering ' . __METHOD__);
              $i = 0;
              $profileIds = \vtlib\Profile::getAllIds();
      Severity: Minor
      Found in app/Db/Fixer.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

      The method maximumFieldsLength() has an NPath complexity of 1730. The configured NPath complexity threshold is 200.
      Open

          public static function maximumFieldsLength(array $conditions = []): array
          {
              $typesNotSupported = ['datetime', 'date', 'year', 'timestamp', 'time'];
              $uiTypeNotSupported = [30];
              $updated = $requiresVerification = $typeNotFound = $notSupported = 0;
      Severity: Minor
      Found in app/Db/Fixer.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 maximumFieldsLength() has a Cyclomatic Complexity of 33. The configured cyclomatic complexity threshold is 10.
      Open

          public static function maximumFieldsLength(array $conditions = []): array
          {
              $typesNotSupported = ['datetime', 'date', 'year', 'timestamp', 'time'];
              $uiTypeNotSupported = [30];
              $updated = $requiresVerification = $typeNotFound = $notSupported = 0;
      Severity: Minor
      Found in app/Db/Fixer.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 baseModuleTools() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
      Open

          public static function baseModuleTools(): int
          {
              $i = 0;
              $allUtility = $missing = $curentProfile2utility = [];
              foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
      Severity: Minor
      Found in app/Db/Fixer.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

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

          public static function baseModuleTools(): int
      Severity: Critical
      Found in app/Db/Fixer.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 59 to the 15 allowed.
      Open

          public static function maximumFieldsLength(array $conditions = []): array
      Severity: Critical
      Found in app/Db/Fixer.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

      Avoid using undefined variables such as '$uiTypeMaxLength' which will lead to PHP notices.
      Open

                  if (isset(\Vtiger_Field_Model::$uiTypeMaxLength[$field['uitype']])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpmd

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$uiTypeMaxLength' which will lead to PHP notices.
      Open

                      $range = \Vtiger_Field_Model::$uiTypeMaxLength[$field['uitype']];
      Severity: Minor
      Found in app/Db/Fixer.php by phpmd

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$typesMaxLength' which will lead to PHP notices.
      Open

                  } elseif (isset(\Vtiger_Field_Model::$typesMaxLength[$type])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpmd

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$typesMaxLength' which will lead to PHP notices.
      Open

                      $range = \Vtiger_Field_Model::$typesMaxLength[$type];
      Severity: Minor
      Found in app/Db/Fixer.php by phpmd

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

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

                          $isExists = (new \App\Db\Query())->from('vtiger_profile2field')->where(['profileid' => $profileId, 'fieldid' => $fieldId])->exists();
      Severity: Minor
      Found in app/Db/Fixer.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 '30', column '21').
      Open

                  $subQuery = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_profile2field')->where(['profileid' => $profileId]);
      Severity: Minor
      Found in app/Db/Fixer.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 '31', column '18').
      Open

                  $query = (new \App\Db\Query())->select(['tabid', 'fieldid'])->from('vtiger_field')->where(['not in', 'vtiger_field.fieldid', $subQuery]);
      Severity: Minor
      Found in app/Db/Fixer.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 '245', column '40').
      Open

                  ->andWhere(['not in', 'tabid', (new \App\Db\Query())->select(['tabid'])->from('vtiger_org_share_action2tab')]);
      Severity: Minor
      Found in app/Db/Fixer.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 '54', column '17').
      Open

              foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
      Severity: Minor
      Found in app/Db/Fixer.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 '241', column '21').
      Open

              $actionIds = (new \App\Db\Query())->select(['share_action_id'])->from('vtiger_org_share_action_mapping')
      Severity: Minor
      Found in app/Db/Fixer.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 '244', column '17').
      Open

              $query = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])
      Severity: Minor
      Found in app/Db/Fixer.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 '59', column '21').
      Open

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Minor
      Found in app/Db/Fixer.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 '236', column '40').
      Open

                  ->andWhere(['not in', 'tabid', (new \App\Db\Query())->select(['tabid'])->from('vtiger_def_org_share')]);
      Severity: Minor
      Found in app/Db/Fixer.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 '133', column '17').
      Open

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Minor
      Found in app/Db/Fixer.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 '100', column '17').
      Open

              foreach ((new \App\Db\Query())->from('vtiger_profile2standardpermissions')->all() as $row) {
      Severity: Minor
      Found in app/Db/Fixer.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 '235', column '17').
      Open

              $query = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])
      Severity: Minor
      Found in app/Db/Fixer.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 '103', column '21').
      Open

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Minor
      Found in app/Db/Fixer.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

      Avoid using static access to class '\App\Log' in method 'profileField'.
      Open

              \App\Log::trace('Exiting ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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 '\vtlib\Profile' in method 'profileField'.
      Open

              $profileIds = \vtlib\Profile::getAllIds();
      Severity: Minor
      Found in app/Db/Fixer.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\Log' in method 'profileField'.
      Open

              \App\Log::trace('Entering ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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 maximumFieldsLength uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                              } else {
                                  $range = '-128,127';
                              }
      Severity: Minor
      Found in app/Db/Fixer.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 maximumFieldsLength uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                              } else {
                                  $range = '-32768,32767';
                              }
      Severity: Minor
      Found in app/Db/Fixer.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\Log' in method 'share'.
      Open

              \App\Log::trace('Entering ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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\Log' in method 'maximumFieldsLength'.
      Open

                      \App\Log::warning("Type not found: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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 maximumFieldsLength uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                      } else {
                          \App\Log::warning("Requires verification: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} <> {$range} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
                          ++$requiresVerification;
                      }
      Severity: Minor
      Found in app/Db/Fixer.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\Log' in method 'maximumFieldsLength'.
      Open

                      \App\Log::trace("Updated: {$field['tablename']}.{$field['columnname']} |maximumlength:  before:{$field['maximumlength']} after: $range |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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 '\Settings_ModuleManager_Module_Model' in method 'baseModuleTools'.
      Open

              $exceptions = \Settings_ModuleManager_Module_Model::getBaseModuleToolsExceptions();
      Severity: Minor
      Found in app/Db/Fixer.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 'maximumFieldsLength'.
      Open

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

                          \App\Log::warning("Requires verification: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} <> {$range} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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 '\vtlib\Profile' in method 'baseModuleActions'.
      Open

              foreach (\vtlib\Profile::getAllIds() as $profileId) {
      Severity: Minor
      Found in app/Db/Fixer.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\Log' in method 'maximumFieldsLength'.
      Open

                              \App\Log::error("Type not allowed: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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 '\vtlib\Profile' in method 'baseModuleTools'.
      Open

              $profileIds = \vtlib\Profile::getAllIds();
      Severity: Minor
      Found in app/Db/Fixer.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\Log' in method 'share'.
      Open

              \App\Log::trace('Exiting ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.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 maximumFieldsLength uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                              } else {
                                  $range = '-2147483648,2147483647';
                              }
      Severity: Minor
      Found in app/Db/Fixer.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 maximumFieldsLength uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      switch ($type) {
                          case 'binary':
                          case 'string':
                          case 'varchar':
      Severity: Minor
      Found in app/Db/Fixer.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 "vtiger_field" 3 times.
      Open

                  $query = (new \App\Db\Query())->select(['tabid', 'fieldid'])->from('vtiger_field')->where(['not in', 'vtiger_field.fieldid', $subQuery]);
      Severity: Critical
      Found in app/Db/Fixer.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 "maximumlength" 7 times.
      Open

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Critical
      Found in app/Db/Fixer.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 "vtiger_tab" 4 times.
      Open

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Critical
      Found in app/Db/Fixer.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 "profileid" 10 times.
      Open

                  $subQuery = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_profile2field')->where(['profileid' => $profileId]);
      Severity: Critical
      Found in app/Db/Fixer.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 "not in" 3 times.
      Open

                  $query = (new \App\Db\Query())->select(['tabid', 'fieldid'])->from('vtiger_field')->where(['not in', 'vtiger_field.fieldid', $subQuery]);
      Severity: Critical
      Found in app/Db/Fixer.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 "isentitytype" 4 times.
      Open

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Critical
      Found in app/Db/Fixer.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 "vtiger_profile2field" 3 times.
      Open

                  $subQuery = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_profile2field')->where(['profileid' => $profileId]);
      Severity: Critical
      Found in app/Db/Fixer.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 "fieldid" 7 times.
      Open

                  $subQuery = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_profile2field')->where(['profileid' => $profileId]);
      Severity: Critical
      Found in app/Db/Fixer.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 "tablename" 6 times.
      Open

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Critical
      Found in app/Db/Fixer.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 "tabid" 25 times.
      Open

                  $query = (new \App\Db\Query())->select(['tabid', 'fieldid'])->from('vtiger_field')->where(['not in', 'vtiger_field.fieldid', $subQuery]);
      Severity: Critical
      Found in app/Db/Fixer.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 "notAllowed" 3 times.
      Open

                  } elseif (isset($exceptions[$row['tabid']]['notAllowed']) && (false === $exceptions[$row['tabid']]['notAllowed'] || isset($exceptions[$row['tabid']]['notAllowed'][$row['activityid']]))) {
      Severity: Critical
      Found in app/Db/Fixer.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 "columnname" 6 times.
      Open

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Critical
      Found in app/Db/Fixer.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 "uitype" 14 times.
      Open

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Critical
      Found in app/Db/Fixer.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 "activityid" 8 times.
      Open

                  $curentProfile2utility[$row['profileid']][$row['tabid']][$row['activityid']] = true;
      Severity: Critical
      Found in app/Db/Fixer.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Avoid unused local variables such as '$value'.
      Open

                          foreach ($allUtility[$moduleId] as $actionId => $value) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpmd

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

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

      Avoid unused local variables such as '$actionName'.
      Open

                      foreach (\Vtiger_Action_Model::$standardActions as $actionId => $actionName) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpmd

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

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

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

                  $query = (new \App\Db\Query())->select(['tabid', 'fieldid'])->from('vtiger_field')->where(['not in', 'vtiger_field.fieldid', $subQuery]);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method warning from undeclared class \App\Log
      Open

                          \App\Log::warning("Requires verification: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} <> {$range} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method trace from undeclared class \App\Log
      Open

              \App\Log::trace('Exiting ' . __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method trace from undeclared class \App\Log
      Open

              \App\Log::trace('Entering ' . __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

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

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

              $query = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method warning from undeclared class \App\Log
      Open

                      \App\Log::warning("Type not found: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method trace from undeclared class \App\Log
      Open

              \App\Log::trace('Entering ' . __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $actionIds = (new \App\Db\Query())->select(['share_action_id'])->from('vtiger_org_share_action_mapping')
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

                  ->andWhere(['not in', 'tabid', (new \App\Db\Query())->select(['tabid'])->from('vtiger_org_share_action2tab')]);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              foreach ((new \App\Db\Query())->from('vtiger_profile2standardpermissions')->all() as $row) {
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

                  $subQuery = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_profile2field')->where(['profileid' => $profileId]);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

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

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

                  ->andWhere(['not in', 'tabid', (new \App\Db\Query())->select(['tabid'])->from('vtiger_def_org_share')]);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

                          $isExists = (new \App\Db\Query())->from('vtiger_profile2field')->where(['profileid' => $profileId, 'fieldid' => $fieldId])->exists();
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $query = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method error from undeclared class \App\Log
      Open

                              \App\Log::error("Type not allowed: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method trace from undeclared class \App\Log
      Open

                      \App\Log::trace("Updated: {$field['tablename']}.{$field['columnname']} |maximumlength:  before:{$field['maximumlength']} after: $range |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

      Call to method trace from undeclared class \App\Log
      Open

              \App\Log::trace('Exiting ' . __METHOD__);
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
      Severity: Critical
      Found in app/Db/Fixer.php by phan

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

              $allUtility = $missing = $curentProfile2utility = [];
      Severity: Minor
      Found in app/Db/Fixer.php by phpmd

      LongVariable

      Since: 0.2

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

      Example

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

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

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

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.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 $i. Configured minimum length is 3.
      Open

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.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 $i. Configured minimum length is 3.
      Open

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.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/Fixer.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 $i. Configured minimum length is 3.
      Open

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.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

              $profileIds = \vtlib\Profile::getAllIds();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

          public static function profileField(): int
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              foreach ($profileIds as $profileId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  $subQuery = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_profile2field')->where(['profileid' => $profileId]);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              \App\Log::trace('Entering ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  foreach ($data as $tabId => $fieldIds) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      foreach ($fieldIds as $fieldId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  $curentProfile2utility[$row['profileid']][$row['tabid']][$row['activityid']] = true;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                              $missing["$profileId:$moduleId:$actionId"] = ['profileid' => $profileId, 'tabid' => $moduleId, 'activityid' => $actionId];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

              foreach ($missing as $row) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                      $range = \Vtiger_Field_Model::$typesMaxLength[$type];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                              $range = (int) $column->size;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

           * Add missing entries in vtiger_profile2field.
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  $allUtility[$row['tabid']][$row['activityid']] = true;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 122 characters
      Open

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  $query->andWhere($conditions);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              while ($field = $dataReader->read()) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                      switch ($type) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                  $range = '-2147483648,2147483647';
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 182 characters
      Open

                              $dbCommand->insert('vtiger_profile2field', ['profileid' => $profileId, 'tabid' => $tabId, 'fieldid' => $fieldId, 'visible' => 0, 'readonly' => 0])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

           * Add missing entries in vtiger_profile2standardpermissions.
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                          case 'mediumint':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

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

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

           * Add missing entries in vtiger_profile2utility.
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $allUtility = $missing = $curentProfile2utility = [];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 146 characters
      Open

                              $missing["$profileId:$moduleId:$actionId"] = ['profileid' => $profileId, 'tabid' => $moduleId, 'activityid' => $actionId];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      if (isset($allUtility[$moduleId])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          foreach ($allUtility[$moduleId] as $actionId => $value) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 150 characters
      Open

                                  $missing["$profileId:$moduleId:$actionId"] = ['profileid' => $profileId, 'tabid' => $moduleId, 'activityid' => $actionId];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  $type = $matches[1] ?? $column->type;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'varchar':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  $query = (new \App\Db\Query())->select(['tabid', 'fieldid'])->from('vtiger_field')->where(['not in', 'vtiger_field.fieldid', $subQuery]);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

              foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  $dbCommand->insert('vtiger_profile2utility', ['profileid' => $row['profileid'], 'tabid' => $row['tabid'], 'activityid' => $row['activityid'], 'permission' => 1])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                              $dbCommand->insert('vtiger_profile2standardpermissions', ['profileid' => $profileId, 'tabid' => $moduleId, 'operation' => $actionId, 'permissions' => 1])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

           * @param array $conditions Additional query conditions
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  } elseif (isset(\Vtiger_Field_Model::$typesMaxLength[$type])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'bigint':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'int':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 149 characters
      Open

                  $query = (new \App\Db\Query())->select(['tabid', 'fieldid'])->from('vtiger_field')->where(['not in', 'vtiger_field.fieldid', $subQuery]);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                              $dbCommand->insert('vtiger_profile2field', ['profileid' => $profileId, 'tabid' => $tabId, 'fieldid' => $fieldId, 'visible' => 0, 'readonly' => 0])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'integer':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $profileIds = \vtlib\Profile::getAllIds();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

      Line exceeds 120 characters; contains 236 characters
      Open

                              \App\Log::error("Type not allowed: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $baseActionIds = array_map('App\Module::getActionId', \Settings_ModuleManager_Module_Model::$baseModuleTools);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                          case 'string':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'varbinary':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                  $range = '4294967295';
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                      $range = '0,' . $range;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

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

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

          public static function baseModuleActions(): int
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          if (!isset($curentProfile[$profileId][$moduleId][$actionId])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  $column = $schema->getTableSchema($field['tablename'])->columns[$field['columnname']];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                  if (7 == $field['uitype'] || 1 == $field['uitype']) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  $data = $query->createCommand()->queryAllByGroup(2);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                              if (!isset($curentProfile2utility[$profileId][$moduleId][$actionId])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 185 characters
      Open

                  $dbCommand->insert('vtiger_profile2utility', ['profileid' => $row['profileid'], 'tabid' => $row['tabid'], 'activityid' => $row['activityid'], 'permission' => 1])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                  $curentProfile[$row['profileid']][$row['tabid']][$row['operation']] = $row['permissions'];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  if (isset($exceptions[$row['tabid']]['allowed'])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  if (isset(\Vtiger_Field_Model::$uiTypeMaxLength[$field['uitype']])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  } elseif (isset($exceptions[$row['tabid']]['notAllowed']) && (false === $exceptions[$row['tabid']]['notAllowed'] || isset($exceptions[$row['tabid']]['notAllowed'][$row['activityid']]))) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      $range = \Vtiger_Field_Model::$uiTypeMaxLength[$field['uitype']];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  foreach ($moduleIds as $moduleId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 189 characters
      Open

                              $dbCommand->insert('vtiger_profile2standardpermissions', ['profileid' => $profileId, 'tabid' => $moduleId, 'operation' => $actionId, 'permissions' => 1])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $typesNotSupported = ['datetime', 'date', 'year', 'timestamp', 'time'];
      Severity: Minor
      Found in app/Db/Fixer.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/Fixer.php by phpcodesniffer

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

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

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

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

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

              $exceptions = \Settings_ModuleManager_Module_Model::getBaseModuleToolsExceptions();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'binary':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      if (!isset($exceptions[$row['tabid']]['allowed'][$row['activityid']])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 199 characters
      Open

                  } elseif (isset($exceptions[$row['tabid']]['notAllowed']) && (false === $exceptions[$row['tabid']]['notAllowed'] || isset($exceptions[$row['tabid']]['notAllowed'][$row['activityid']]))) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

              foreach ((new \App\Db\Query())->from('vtiger_profile2standardpermissions')->all() as $row) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              foreach (\vtlib\Profile::getAllIds() as $profileId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

           * Fixes the maximum value allowed for fields.
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                              \App\Log::error("Type not allowed: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 133 characters
      Open

                  $subQuery = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_profile2field')->where(['profileid' => $profileId]);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              \App\Log::trace('Exiting ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

          public static function baseModuleTools(): int
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          if (!isset($curentProfile2utility[$profileId][$moduleId][$actionId])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

              $updated = $requiresVerification = $typeNotFound = $notSupported = 0;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                                  $missing["$profileId:$moduleId:$actionId"] = ['profileid' => $profileId, 'tabid' => $moduleId, 'activityid' => $actionId];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 136 characters
      Open

              $query = (new \App\Db\Query())->select(['tablename', 'columnname', 'fieldid', 'maximumlength', 'uitype'])->from('vtiger_field');
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  if (\in_array($type, $typesNotSupported) || \in_array($field['uitype'], $uiTypeNotSupported)) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          $isExists = (new \App\Db\Query())->from('vtiger_profile2field')->where(['profileid' => $profileId, 'fieldid' => $fieldId])->exists();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

              foreach ($profileIds as $profileId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $curentProfile = [];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

          public static function maximumFieldsLength(array $conditions = []): array
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $uiTypeNotSupported = [30];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  preg_match('/^([\w\-]+)/i', $column->dbType, $matches);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                              if ($column->unsigned) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 153 characters
      Open

                          $isExists = (new \App\Db\Query())->from('vtiger_profile2field')->where(['profileid' => $profileId, 'fieldid' => $fieldId])->exists();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  foreach ($moduleIds as $moduleId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      foreach ($baseActionIds as $actionId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 122 characters
      Open

              $moduleIds = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])->column();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      foreach (\Vtiger_Action_Model::$standardActions as $actionId => $actionName) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $dbCommand = $db->createCommand();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $schema = $db->getSchema();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $dataReader = $query->createCommand()->query();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                          case 'smallint':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  if ($update && false !== $range) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 154 characters
      Open

              return ['NotSupported' => $notSupported, 'TypeNotFound' => $typeNotFound, 'RequiresVerification' => $requiresVerification, 'Updated' => $updated];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

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

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

                                  $range = '65535';
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                                  $range = '0,' . $range;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

          public static function share(): int
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                  $dbCommand->insert('vtiger_def_org_share', ['tabid' => $tabId, 'permission' => 3, 'editstatus' => 0])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'decimal':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $actionIds = (new \App\Db\Query())->select(['share_action_id'])->from('vtiger_org_share_action_mapping')
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 144 characters
      Open

                  ->where(['share_action_name' => ['Public: Read Only', 'Public: Read, Create/Edit', 'Public: Read, Create/Edit, Delete', 'Private']])
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                              if ($column->unsigned) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 228 characters
      Open

                      \App\Log::warning("Type not found: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  } elseif ($field['maximumlength'] != $range) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                      $dbCommand->update('vtiger_field', ['maximumlength' => $range], ['fieldid' => $field['fieldid']])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

              $dbCommand = \App\Db::getInstance()->createCommand();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                  $range = '-32768,32767';
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                  $range = '255';
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 251 characters
      Open

                          \App\Log::warning("Requires verification: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} <> {$range} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

              \App\Log::trace('Entering ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              foreach ($query->column() as $tabId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                  if (7 == $field['uitype'] || 1 == $field['uitype']) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  ->andWhere(['not in', 'tabid', (new \App\Db\Query())->select(['tabid'])->from('vtiger_def_org_share')]);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              $query = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                      \App\Log::warning("Type not found: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                  $insertedData = [];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                                      $range = '0,' . $range;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                                  if (7 == $field['uitype'] || 1 == $field['uitype']) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                          $update = true;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          \App\Log::warning("Requires verification: {$field['tablename']}.{$field['columnname']} |uitype: {$field['uitype']} |maximumlength: {$field['maximumlength']} <> {$range} |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 123 characters
      Open

                  ->andWhere(['not in', 'tabid', (new \App\Db\Query())->select(['tabid'])->from('vtiger_org_share_action2tab')]);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      $insertedData[] = [$id, $tabId];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              \App\Log::trace('Exiting ' . __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                          case 'tinyint':
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                                  $range = '-128,127';
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  if (false === $range) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                      \App\Log::trace("Updated: {$field['tablename']}.{$field['columnname']} |maximumlength:  before:{$field['maximumlength']} after: $range |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

           * Add missing entries in vtiger_def_org_share and vtiger_org_share_action2tab.
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                              $range = 10 ** (((int) $column->size) - ((int) $column->scale)) - 1;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

              $query = (new \App\Db\Query())->select(['tabid'])->from('vtiger_tab')->where(['isentitytype' => 1])
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  $dbCommand->insert('vtiger_def_org_share', ['tabid' => $tabId, 'permission' => 3, 'editstatus' => 0])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 122 characters
      Open

                      if (\in_array($field['uitype'], [1, 2, 7, 9, 10, 16, 52, 53, 56, 71, 72, 120, 156, 300, 308, 317, 327])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  ->andWhere(['not in', 'tabid', (new \App\Db\Query())->select(['tabid'])->from('vtiger_org_share_action2tab')]);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              foreach ($query->column() as $tabId) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

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

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

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

      Line exceeds 120 characters; contains 213 characters
      Open

                      \App\Log::trace("Updated: {$field['tablename']}.{$field['columnname']} |maximumlength:  before:{$field['maximumlength']} after: $range |type:{$type}|{$column->type}|{$column->dbType}", __METHOD__);
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  foreach ($actionIds as $id) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                              if ($column->unsigned) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                              if ($column->unsigned) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                      if (\in_array($field['uitype'], [1, 2, 7, 9, 10, 16, 52, 53, 56, 71, 72, 120, 156, 300, 308, 317, 327])) {
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

              $i = 0;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

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

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

                      $dbCommand->update('vtiger_field', ['maximumlength' => $range], ['fieldid' => $field['fieldid']])->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

              return ['NotSupported' => $notSupported, 'TypeNotFound' => $typeNotFound, 'RequiresVerification' => $requiresVerification, 'Updated' => $updated];
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                                      $range = '0,' . $range;
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

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

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

                  ->where(['share_action_name' => ['Public: Read Only', 'Public: Read, Create/Edit', 'Public: Read, Create/Edit, Delete', 'Private']])
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      Line exceeds 120 characters; contains 123 characters
      Open

                  $dbCommand->batchInsert('vtiger_org_share_action2tab', ['share_action_id', 'tabid'], $insertedData)->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

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

                  $dbCommand->batchInsert('vtiger_org_share_action2tab', ['share_action_id', 'tabid'], $insertedData)->execute();
      Severity: Minor
      Found in app/Db/Fixer.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status