YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/LayoutEditor/models/Field.php

Summary

Maintainability
D
2 days
Test Coverage
F
26%

File Field.php has 444 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/* +**********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.1
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
Severity: Minor
Found in modules/Settings/LayoutEditor/models/Field.php - About 6 hrs to fix

    Method getFieldItemByName has 144 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getFieldItemByName($name)
        {
            if (isset($this->items[$name])) {
                return $this->items[$name];
            }
    Severity: Major
    Found in modules/Settings/LayoutEditor/models/Field.php - About 5 hrs to fix

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

      class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
      {
          /** @var Settings_Vtiger_Field_Model[] Item field models */
          private $items = [];
          /** @var Vtiger_Field_Model|null Source field model */

      Method delete has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function delete()
          {
              $db = \App\Db::getInstance();
              try {
                  parent::delete();
      Severity: Major
      Found in modules/Settings/LayoutEditor/models/Field.php - About 2 hrs to fix

        Function getFieldItemByName has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getFieldItemByName($name)
            {
                if (isset($this->items[$name])) {
                    return $this->items[$name];
                }
        Severity: Minor
        Found in modules/Settings/LayoutEditor/models/Field.php - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

        class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
        {
            /** @var Settings_Vtiger_Field_Model[] Item field models */
            private $items = [];
            /** @var Vtiger_Field_Model|null Source field model */
        Severity: Minor
        Found in modules/Settings/LayoutEditor/models/Field.php - About 2 hrs to fix

          Function delete has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function delete()
              {
                  $db = \App\Db::getInstance();
                  try {
                      parent::delete();
          Severity: Minor
          Found in modules/Settings/LayoutEditor/models/Field.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 getFieldItemByName() has 148 lines of code. Current threshold is set to 100. Avoid really long methods.
          Open

              public function getFieldItemByName($name)
              {
                  if (isset($this->items[$name])) {
                      return $this->items[$name];
                  }

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

              public function delete()
              {
                  $db = \App\Db::getInstance();
                  try {
                      parent::delete();

          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 getFieldItemByName() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
          Open

              public function getFieldItemByName($name)
              {
                  if (isset($this->items[$name])) {
                      return $this->items[$name];
                  }

          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

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

          class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model

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

          The class Settings_LayoutEditor_Field_Model has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
          Open

          class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
          {
              /** @var Settings_Vtiger_Field_Model[] Item field models */
              private $items = [];
              /** @var Vtiger_Field_Model|null Source field model */

          CouplingBetweenObjects

          Since: 1.1.0

          A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

          Example

          class Foo {
              /**
               * @var \foo\bar\X
               */
              private $x = null;
          
              /**
               * @var \foo\bar\Y
               */
              private $y = null;
          
              /**
               * @var \foo\bar\Z
               */
              private $z = null;
          
              public function setFoo(\Foo $foo) {}
              public function setBar(\Bar $bar) {}
              public function setBaz(\Baz $baz) {}
          
              /**
               * @return \SplObjectStorage
               * @throws \OutOfRangeException
               * @throws \InvalidArgumentException
               * @throws \ErrorException
               */
              public function process(\Iterator $it) {}
          
              // ...
          }

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

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

              public static function getInstance($value, $module = false)

          BooleanArgumentFlag

          Since: 1.4.0

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

          Example

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

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

          Missing class import via use statement (line '113', column '20').
          Open

                          'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),

          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 '126', column '21').
          Open

                                  $query = (new \App\Db\Query())->from('vtiger_field')

          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 '183', column '69').
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          MissingImport

          Since: 2.7.0

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

          Example

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

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

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

              public static function getInstanceFromBlockIdList($blockId, $moduleInstance = false)

          BooleanArgumentFlag

          Since: 1.4.0

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

          Example

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

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

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

                  $query = (new \App\Db\Query())->from('vtiger_field')->where(['block' => $blockId])->orderBy('sequence');

          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 '202', column '23').
          Open

                  $maxSequence = (new \App\Db\Query())->from('vtiger_field')

          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 '187', column '68').
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();

          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 '424', column '39').
          Open

                  return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];

          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 '181', column '69').
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          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 '188', column '68').
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();

          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\Db' in method 'delete'.
          Open

                  $db = \App\Db::getInstance();

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function delete()
              {
                  $db = \App\Db::getInstance();
                  try {
                      parent::delete();

          IfStatementAssignment

          Since: 2.7.0

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

          Example

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

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

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

                  } else {
                      $label = $this->fieldTypeLabel[$this->getFieldDataType()] ?? '';
                  }

          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 'Settings_Search_Module_Model' in method 'delete'.
          Open

                      $searchModel = Settings_Search_Module_Model::getInstance('Settings:Search');

          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 'move'.
          Open

                  $db = \App\Db::getInstance();

          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 'getWebserviceData'.
          Open

                  return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];

          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\Module' in method 'delete'.
          Open

                      $entityInfo = \App\Module::getEntityInfo($fldModule);

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function isActiveOptionDisabled(): bool
              {
                  if (!($sourceField = $this->getSourceField())) {
                      $sourceField = $this;
                  }

          IfStatementAssignment

          Since: 2.7.0

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

          Example

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

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

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

              public function getFieldItemByName($name)
              {
                  if (isset($this->items[$name])) {
                      return $this->items[$name];
                  }

          IfStatementAssignment

          Since: 2.7.0

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

          Example

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

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

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

                  } else {
                      $createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();
                  }

          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\Utils' in method 'updateWebserviceData'.
          Open

                      $createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();

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

                  } else {
                      $this->set('defaultvalue', $data['default_value']);
                  }

          ElseExpression

          Since: 1.4.0

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

          Example

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

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

          Avoid using static access to class '\App\Cache' in method 'updateWebserviceData'.
          Open

                  \App\Cache::delete('WebserviceAppsFields', $webserviceApp);

          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\Fields\MapCoordinates' in method 'delete'.
          Open

                                  \App\Fields\MapCoordinates::reloadHandler();

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

                              'isEditableReadOnly' => !App\Config::developer('CHANGE_GENERATEDTYPE')

          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 'delete'.
          Open

                      \App\Log::error($ex->__toString());

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

                  } else {
                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();
                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();
          
                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();

          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 "sequence - 1" 3 times.
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          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 "typeofdata" 11 times.
          Open

                              'typeofdata' => 'V~O',

          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" 16 times.
          Open

                                      ->andWhere(['in', 'uitype', [15, 16, 33]]);

          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 "label" 11 times.
          Open

                              'label' => 'LBL_ICON',

          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 "fieldname" 3 times.
          Open

                                      ->where(['fieldname' => $fieldname])

          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" 11 times.
          Open

                              'maximumlength' => '255',

          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 "purifyType" 11 times.
          Open

                              'purifyType' => \App\Purifier::TEXT,

          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 "block = :olderBlockId" 3 times.
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          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 ":olderSequence" 3 times.
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          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 "sequence" 11 times.
          Open

                  $newSequence = $fieldNewDetails['sequence'];

          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 ":olderBlockId" 3 times.
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          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" 5 times.
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();

          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 "defaultvalue" 4 times.
          Open

                      $this->set('defaultvalue', '');

          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 "masseditable" 3 times.
          Open

                  if (0 == $this->get('masseditable') || 1 != $this->get('displaytype') || 3 == $this->get('masseditable')) {

          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 "serverid" 3 times.
          Open

                  return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];

          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 "image" 3 times.
          Open

                  'image' => 'Image',

          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_" 3 times.
          Open

                                      $db->createCommand()->dropTable('vtiger_' . $fieldname)->execute();

          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 ":newSequence" 3 times.
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          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 "column" 12 times.
          Open

                      $columnName = $this->get('column');

          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 "block" 3 times.
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();

          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_field" 10 times.
          Open

                                  $query = (new \App\Db\Query())->from('vtiger_field')

          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 "presence" 4 times.
          Open

                      ->where(['block' => $blockId, 'presence' => [0, 2]])->max('sequence');

          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 "quickcreate" 3 times.
          Open

                  if (0 == $this->get('quickcreate') || 3 == $this->get('quickcreate') || !$moduleModel->isQuickCreateSupported()) {

          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 "w_#__fields_server" 3 times.
          Open

                  return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];

          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 "multiImage" 3 times.
          Open

                  'multiImage' => 'MultiImage',

          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 parameters such as '$viewName'.
          Open

              public function isEditable(string $viewName = 'Edit'): bool

          UnusedFormalParameter

          Since: 0.2

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

          Example

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

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

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

                                  $query = (new \App\Db\Query())->from('vtiger_field')

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();

          Argument 1 (value) is int but \Settings_LayoutEditor_Field_Model::getInstance() takes string defined at /code/modules/Settings/LayoutEditor/models/Field.php:359
          Open

                      $fieldInstance = self::getInstance($fieldId);

          Reference to undeclared property \CRMEntity->mandatory_fields
          Open

                      $compulsoryMandatoryFieldList = $this->getModule()->getEntityInstance()->mandatory_fields ?? [];

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          Expected @param annotation for blockId to be before the @param annotation for moduleInstance
          Open

               * @param Vtiger_Module_Model $moduleInstance

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

                                      $db->createCommand()->delete('vtiger_picklist', ['name' => $fieldname])->execute();

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();

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

                          $db->createCommand()->delete('vtiger_convertleadmapping', ['leadfid' => $id])->execute();

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

                  $createCommand = \App\Db::getInstance('webservice')->createCommand();

          Argument 2 (key) is int but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
          Open

                  \App\Cache::delete('WebserviceAppsFields', $webserviceApp);

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

                          $db->createCommand()->dropColumn($tablename, $columnName)->execute();

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

                          'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),

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

                      $db->createCommand()->delete('vtiger_cvcolumnlist', [

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

                          $db->createCommand()->update('vtiger_convertleadmapping', [$mapDelId[$fldModule] => 0], [$mapDelId[$fldModule] => $id])->execute();

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

                                      $db->createCommand()->dropTable('vtiger_' . $fieldname)->execute();

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

                      $db->createCommand()->delete('u_#__cv_condition', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();

          Call to method reloadHandler from undeclared class \App\Fields\MapCoordinates
          Open

                                  \App\Fields\MapCoordinates::reloadHandler();

          Saw unextractable annotation for comment '* @param <type> $module - optional - module instance'</type>
          Open

               * @param <type> $module - optional - module instance

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();

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

                  $maxSequence = (new \App\Db\Query())->from('vtiger_field')

          Call to undeclared method \Vtiger_Field_Model::setSourceField
          Open

                      $itemModel = \Vtiger_Field_Model::init($qualifiedModuleName, $params, $name)->setSourceField($this);

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();

          Default value for \Vtiger_Module_Model $moduleInstance can't be false
          Open

              public static function getInstanceFromBlockIdList($blockId, $moduleInstance = false)

          Call to method __construct from undeclared class \yii\db\Expression
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();

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

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

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

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          Returning type null but getFieldItemByName() is declared to return \Vtiger_Field_Model
          Open

                  return $itemModel;

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

                      $db->createCommand()->delete('vtiger_cvcolumnlist', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();

          Saw possibly unextractable annotation for a fragment of comment '* @param array List of block ids': after array, did not see an element name (will guess based on comment order)
          Open

               * @param array List of block ids

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

                  $query = (new \App\Db\Query())->from('vtiger_field')->where(['block' => $blockId])->orderBy('sequence');

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

                  return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];

          Saw unextractable annotation for comment '* @param <array> $fieldNewDetails'</array>
          Open

               * @param <Array> $fieldNewDetails

          Saw unextractable annotation for comment '* @param <array> $fieldOlderDetails'</array>
          Open

               * @param <Array> $fieldOlderDetails

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

                      App\Db::getInstance('admin')->createCommand()->delete('a_#__mapped_fields', ['or', ['source' => (string) $id], ['target' => (string) $id]])->execute();

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

                                          $db->createCommand()->dropTable('vtiger_' . $fieldname . '_seq')->execute();

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

                      \App\Log::error($ex->__toString());

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

                  $compulsoryMandatoryFieldList = [];

          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

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model

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

                  $db = \App\Db::getInstance();

          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

          The class Settings_LayoutEditor_Field_Model is not named in CamelCase.
          Open

          class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
          {
              /** @var Settings_Vtiger_Field_Model[] Item field models */
              private $items = [];
              /** @var Vtiger_Field_Model|null Source field model */

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

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

                      $id = $this->getId();

          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();

          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

          Terminating statement must be indented to the same level as the CASE body
          Open

                                  break;

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

              const WEBSERVICE_APPS_VISIBILITY = [

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

                  1 => 'LBL_DISPLAY_TYPE_1',

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

                  2 => 'LBL_DISPLAY_TYPE_2',

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

                  'string' => 'Text',

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

                  0 => 'LBL_WSA_VISIBILITY_DEFAULT',

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

                  'email' => 'Email',

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

              private $items = [];

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

                  'percentage' => 'Percent',

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

                  'phone' => 'Phone',

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

                  'url' => 'URL',

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

                  3 => 'LBL_DISPLAY_TYPE_3',

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

              /** @var Settings_Vtiger_Field_Model[] Item field models */

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

                  'time' => 'Time',

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

                  'picklist' => 'Picklist',

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

                  10 => 'LBL_DISPLAY_TYPE_10',

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

                  'text' => 'TextArea',

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

                  6 => 'LBL_DISPLAY_TYPE_6',

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

                  'multipicklistTags' => 'MultipicklistTags',

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

              public $sourceFieldModel;

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

              /** @var Vtiger_Field_Model|null Source field model */

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

              /** @var array Webservice app visibility */

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

                  'date' => 'Date',

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

                  4 => 'LBL_DISPLAY_TYPE_4',

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

                  9 => 'LBL_DISPLAY_TYPE_9',

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

              ];

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

              /** @var array Translations of field types */

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

                  'double' => 'Decimal',

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

                  'integer' => 'Integer',

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

              public $fieldTypeLabel = [

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

               * Function to remove field.

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

              public function delete()

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

                  try {

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

                                  break;

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

                                  'name' => $name,

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

                              $searchModel->save($params);

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

                      \App\Log::error($ex->__toString());

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

                      if ($newSequence > $olderSequence) {

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

                      } elseif ($newSequence < $olderSequence) {

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

                  'token' => 'Token',

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

                      $db->createCommand()->delete('u_#__cv_condition', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();

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

                          $db->createCommand()->delete('vtiger_convertleadmapping', ['leadfid' => $id])->execute();

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

                              case 'mapCoordinates':

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

                  } catch (\Throwable $ex) {

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

                  $newBlockId = $fieldNewDetails['blockId'];

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

                  'reference' => 'Related1M',

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

                  'group' => 'Group'

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

               * Get field data type label.

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

                      $fieldname = $this->getName();

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

                              break;

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

                          }

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

               * @param <Array> $fieldNewDetails

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

               */

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

                  $olderSequence = $fieldOlderDetails['sequence'];

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

                  'image' => 'Image',

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

                  'smtp' => 'Smtp',

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

               */

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

                      if ('vtiger_crmentity' !== $tablename) {

          Line exceeds 120 characters; contains 134 characters
          Open

                      $db->createCommand()->delete('vtiger_cvcolumnlist', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();

          Line exceeds 120 characters; contains 132 characters
          Open

                      $db->createCommand()->delete('u_#__cv_condition', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();

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

                                      ->andWhere(['in', 'uitype', [15, 16, 33]]);

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

                          if (false !== ($fieldNameKey = array_search($fieldname, $entityInfo[$key]))) {

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

                              ];

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

               * Function to Move the field.

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

                  'multiReferenceValue' => 'MultiReferenceValue',

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

                  'multiEmail' => 'MultiEmail',

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

                  'advPercentage' => 'AdvPercentage',

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

                      App\Db::getInstance('admin')->createCommand()->delete('a_#__mapped_fields', ['or', ['source' => (string) $id], ['target' => (string) $id]])->execute();

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

                      if ('Leads' === $fldModule) {

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

                                      }

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

                  }

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

               * @param <Array> $fieldOlderDetails

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

                  $olderBlockId = $fieldOlderDetails['blockId'];

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

                  'multiDomain' => 'MultiDomain',

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

              /** @var array Webservice field data */

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

                  if (300 === $this->getUIType()) {

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

                  } else {

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

               */

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

                  $db = \App\Db::getInstance();

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

                      $fldModule = $this->getModuleName();

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

                  $db = \App\Db::getInstance();

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

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

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

                  'datetime' => 'DateTime',

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

                  'multiReference' => 'MultiReference',

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

              ];

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

              protected $webserviceData;

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

              /**

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

                              $params = [

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

              /**

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

                  'multipicklist' => 'MultiSelectCombo',

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

                          $db->createCommand()->dropColumn($tablename, $columnName)->execute();

          Line exceeds 120 characters; contains 163 characters
          Open

                      App\Db::getInstance('admin')->createCommand()->delete('a_#__mapped_fields', ['or', ['source' => (string) $id], ['target' => (string) $id]])->execute();

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

                      //we have to remove the entries in customview and report related tables which have this field ($colName)

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

                      //Deleting from convert lead mapping vtiger_table- Jaguar

          Line exceeds 120 characters; contains 147 characters
          Open

                          $db->createCommand()->update('vtiger_convertleadmapping', [$mapDelId[$fldModule] => 0], [$mapDelId[$fldModule] => $id])->execute();

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

                  } else {

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

                  'rangeTime' => 'RangeTime',

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

                  'twitter' => 'Twitter',

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

              }

          Line exceeds 120 characters; contains 130 characters
          Open

                          'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),

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

                      ])->execute();

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

                                  if (!$dataReader->count()) {

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

                              break;

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

                      }

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

                      $searchModel = Settings_Search_Module_Model::getInstance('Settings:Search');

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

              public function move($fieldNewDetails, $fieldOlderDetails)

          Line exceeds 120 characters; contains 323 characters
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

          Line exceeds 120 characters; contains 129 characters
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();

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

                  'serverAccess' => 'ServerAccess',

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

                  'multiAttachment' => 'MultiAttachment',

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

              /**

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

                      $columnName = $this->get('column');

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

                      }

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

                      throw $ex;

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

              }

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

                  'userCreator' => 'LBL_USER',

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

               *

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

              public function getFieldDataTypeLabel(): string

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

                          'source_field_name' => $fieldname,

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

                          $db->createCommand()->update('vtiger_convertleadmapping', [$mapDelId[$fldModule] => 0], [$mapDelId[$fldModule] => $id])->execute();

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

                                      $db->createCommand()->dropTable('vtiger_' . $fieldname)->execute();

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

                                  'value' => $entityInfo[$key],

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();

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

                  'country' => 'Country',

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

                  'currency' => 'Currency',

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

                      $label = 'Editor';

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

                      $label = $this->fieldTypeLabel[$this->getFieldDataType()] ?? '';

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

                  }

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

                      $tabId = $this->getModuleId();

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

                      } elseif ('Accounts' === $fldModule) {

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

                                      if ($db->isTableExists('vtiger_' . $fieldname . '_seq')) {

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

                      foreach (['fieldnameArr' => 'fieldname', 'searchcolumnArr' => 'searchcolumn'] as $key => $name) {

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

                              unset($entityInfo[$key][$fieldNameKey]);

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

                                  'tabid' => $tabId,

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

              {

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

                  $newSequence = $fieldNewDetails['sequence'];

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

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

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

                  'languages' => 'LBL_LANGUAGE',

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

                  'boolean' => 'Checkbox',

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

                                          $db->createCommand()->dropTable('vtiger_' . $fieldname . '_seq')->execute();

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

                                  }

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

                                  \App\Fields\MapCoordinates::reloadHandler();

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

               *

          Line exceeds 120 characters; contains 323 characters
          Open

                          $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();

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

                  'categoryMultipicklist' => 'CategoryMultipicklist',

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

                  'multiImage' => 'MultiImage',

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

                  'mapCoordinates' => 'MapCoordinates',

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

               * @return string

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

              {

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

                      $id = $this->getId();

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

                      $tablename = $this->get('table');

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

                          'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),

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

                          case 'picklist':

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

                          case 'multipicklist':

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

                                  $query = (new \App\Db\Query())->from('vtiger_field')

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

                                      ->where(['fieldname' => $fieldname])

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

                                      $db->createCommand()->delete('vtiger_picklist', ['name' => $fieldname])->execute();

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

                          default:

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

              {

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

                      parent::delete();

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

                      $db->createCommand()->delete('vtiger_cvcolumnlist', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();

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

                      $db->createCommand()->delete('vtiger_cvcolumnlist', [

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

                          $mapDelId = ['Accounts' => 'accountfid'];

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

                      switch ($this->getFieldDataType()) {

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

                                  $dataReader = $query->createCommand()->query();

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

                      $entityInfo = \App\Module::getEntityInfo($fldModule);

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

                      }

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

                      $fieldInstance->set('presence', 2);

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

                      $fieldInstance->save();

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

               * @param Vtiger_Field_Model $fieldModel

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

               * @return Vtiger_Field_Model|null

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

              public function isActiveOptionDisabled(): bool

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

                  if (!($sourceField = $this->getSourceField())) {

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

               */

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

              {

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

              }

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

               *

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

                  'skype' => 'Skype',

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

                  'tree' => 'Tree',

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

                  return $label;

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

                      }

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

                                      //To Delete Sequence Table

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

                      }

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

                  if ($olderBlockId == $newBlockId) {

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

                  $maxSequence = (new \App\Db\Query())->from('vtiger_field')

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

               *

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

               *

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

               */

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

               */

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

               * @return bool

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

                      return true;

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

              public function isSummaryFieldOptionDisabled()

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

               * @return bool true/false

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();

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

                  foreach ($fieldIdsList as $fieldId) {

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

                  return $this->getSourceField() ? $this->getSourceField()->getModule() : parent::getModule();

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

               * Function which will specify whether the active option is disabled.

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

               *

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

              /**

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

                  return 70 === $this->get('uitype');

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

              public function setSourceField(Vtiger_Field_Model $fieldModel)

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

                  return $this->sourceFieldModel;

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

              }

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

               *

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

                  }

          Line exceeds 120 characters; contains 122 characters
          Open

                  return \in_array($this->getName(), $compulsoryMandatoryFieldList) || \in_array($this->get('uitype'), ['4', '70']);

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

              }

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

              /**

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

                  }

          Line exceeds 120 characters; contains 122 characters
          Open

                  if (0 == $this->get('quickcreate') || 3 == $this->get('quickcreate') || !$moduleModel->isQuickCreateSupported()) {

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

                  return false;

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

                  return !(\in_array($this->get('uitype'), ['4', '70']) || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType());

          Line exceeds 120 characters; contains 259 characters
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();

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

              {

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

                  return $this;

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

              {

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

                  if (!$this->getSourceField()) {

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

               * @return bool

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

                  return false;

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

               * Function which will specify whether the default value option is disabled.

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

               * @return bool

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

               * @return bool

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

              }

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

              /**

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

              {

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

              {

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

                  if (0 == $this->get('quickcreate') || 3 == $this->get('quickcreate') || !$moduleModel->isQuickCreateSupported()) {

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

              {

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

                  if ($this->isMandatoryOptionDisabled() || $this->isReferenceField() || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType()) {

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

              }

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

               */

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

               *

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();

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

               *

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

                      ++$maxSequence;

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

               *

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

               */

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

              public function getModule()

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

              /**

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

               * Function which specifies whether the field can have mandatory switch to happen.

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

                  $compulsoryMandatoryFieldList = [];

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

                  return \in_array($this->getName(), $compulsoryMandatoryFieldList) || \in_array($this->get('uitype'), ['4', '70']);

          Line exceeds 120 characters; contains 140 characters
          Open

                  return 0 === (int) $sourceField->get('presence') || 306 === (int) $sourceField->get('uitype') || $this->isMandatoryOptionDisabled();

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

               * Function which will specify whether the mass edit option is disabled.

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

              /**

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

               * @param string $viewName

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

              public function isEditable(string $viewName = 'Edit'): bool

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

              /**

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

               * @return $this

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

                  $this->sourceFieldModel = $fieldModel;

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

              public function isMandatoryOptionDisabled(): bool

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

                      $compulsoryMandatoryFieldList = $this->getModule()->getEntityInstance()->mandatory_fields ?? [];

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

                  return 0 === (int) $sourceField->get('presence') || 306 === (int) $sourceField->get('uitype') || $this->isMandatoryOptionDisabled();

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

              public function isDefaultValueForWebservice(): bool

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

              {

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

               *

          Line exceeds 120 characters; contains 153 characters
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();

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

               *

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

              {

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

               *

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

               */

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

               * A function that will determine if the default value option is disabled for an WebserviceApps configuration.

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

              {

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

                      ->where(['block' => $blockId, 'presence' => [0, 2]])->max('sequence');

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

                  }

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

               *

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

               * @return bool

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

              }

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

                      return true;

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

               */

          Line exceeds 120 characters; contains 248 characters
          Open

                      $db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();

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

               * @param int[] $fieldIdsList

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

              public static function makeFieldActive($fieldIdsList, $blockId)

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

               * Set source field model.

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

              {

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

              }

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

                  return false;

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

              /**

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

               * Function to check whether summary field option is disable or not.

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

              /**

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

               * @return Vtiger_Module_Model

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

                      $sourceField = $this;

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

                  $moduleModel = $this->getModule();

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

                  }

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

              /**

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

              public function isMassEditOptionDisabled()

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

              }

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

              /**

          Line exceeds 120 characters; contains 150 characters
          Open

                  return !(\in_array($this->get('uitype'), ['4', '70']) || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType());

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

              {

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

                      $fieldInstance = self::getInstance($fieldId);

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

               * Get module model.

          Line exceeds 120 characters; contains 165 characters
          Open

                  if ($this->isMandatoryOptionDisabled() || $this->isReferenceField() || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType()) {

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

               * @return bool true/false

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

               * Function to check field is editable or not.

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

                      $fieldInstance->set('sequence', $maxSequence);

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

              }

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

              }

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

              public function getSourceField(): ?Vtiger_Field_Model

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

              }

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

               * Function which will specify whether the quickcreate option is disabled.

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

               */

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

                  if (0 == $this->get('masseditable') || 1 != $this->get('displaytype') || 3 == $this->get('masseditable')) {

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

               *

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

                      $db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();

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

               * Function to activate field.

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

               * @param int   $blockId

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

               */

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

              /**

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

               * Get source field model.

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

               * @return bool - true if we can make a field mandatory and non mandatory , false if we cant change previous state

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

               */

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

              /**

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

              public function isQuickCreateOptionDisabled()

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

                      return true;

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

                  }

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

                  $objectProperties = get_object_vars($fieldObject);

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

                  foreach ($objectProperties as $properName => $propertyValue) {

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

                      $blockId = [$blockId];

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

                  $query = (new \App\Db\Query())->from('vtiger_field')->where(['block' => $blockId])->orderBy('sequence');

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

              }

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

               */

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

              /**

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

                  $params = [];

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

               * Function to get instance.

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

               *

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

               */

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

                          $fieldModel->setModule($moduleInstance);

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

              /**

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

              /**

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

                          $params = [

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

               * Function to get all fields list for all blocks.

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

                  $fieldInfo = parent::getFieldInfo();

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

              public function getWebserviceData(int $webserviceApp): array

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

                      return $this->webserviceData;

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

               * Update webservice data.

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

                      return $this->items[$name];

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

                              'purifyType' => \App\Purifier::TEXT,

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

                      case 'fieldlabel':

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

                  $fieldObject = parent::getInstance($value, $module);

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

               * @param array List of block ids

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

               * @param string $value  - fieldname or fieldid

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

               * @param Vtiger_Module_Model $moduleInstance

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

                  $data = $this->getWebserviceData($webserviceApp);

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

              {

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

                      $this->set('defaultvalue', '');

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

                  $createCommand = \App\Db::getInstance('webservice')->createCommand();

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

                  }

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

               *

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

              }

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

                              'name' => $name,

          Line exceeds 120 characters; contains 269 characters
          Open

                  if ('ModComments' === $this->getModuleName() && \in_array($this->getName(), ['commentcontent', 'userid', 'created_user_id', 'customer', 'reasontoedit', 'parents', 'assigned_user_id', 'creator', 'modifiedtime', 'related_to', 'createdtime', 'parent_comments'])) {

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

                      $fieldModel->{$properName} = $propertyValue;

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

              public static function getInstanceFromBlockIdList($blockId, $moduleInstance = false)

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

               * @return array List of Field models Settings_LayoutEditor_Field_Model

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

               * @param int $webserviceApp

          Line exceeds 120 characters; contains 136 characters
          Open

                      $createCommand->update('w_#__fields_server', $data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->execute();

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

                  }

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

                  $fieldInfo['isSummaryFieldDisabled'] = $this->isSummaryFieldOptionDisabled();

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

                      $createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();

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

               *

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

                  }

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

               *

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

               *

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

               * @param array $data

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

                  if ($this->getWebserviceData($webserviceApp)) {

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

              public function getFieldItemByName($name)

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

                      return false;

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

                  $fieldModel = new self();

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

               *

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

                  if (!\is_array($blockId)) {

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

                      $fieldModel->initialize($row);

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

              {

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

               * @param int $webserviceApp

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

               * Load webservice data.

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

               */

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

               */

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

              /**

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

                              'column' => $name,

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

                              'uitype' => 62,

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

                              'table' => 'vtiger_field',

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

                              'fieldDataType' => 'icon'

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

                          $params = [

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

                  if ('ModComments' === $this->getModuleName() && \in_array($this->getName(), ['commentcontent', 'userid', 'created_user_id', 'customer', 'reasontoedit', 'parents', 'assigned_user_id', 'creator', 'modifiedtime', 'related_to', 'createdtime', 'parent_comments'])) {

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

               * @param mixed               $blockId

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

                      }

          Line exceeds 120 characters; contains 204 characters
          Open

                  return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];

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

                  } else {

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

               * @return self

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

                  $fieldModelsList = [];

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

                      if ($moduleInstance) {

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

                  if (!empty($data['visibility'])) {

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

               * @param int   $webserviceApp

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

               * Get fields instance by name.

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

                  }

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

               */

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

              {

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

              public function isDefaultValueOptionDisabled(): bool

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

                  }

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

               */

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

               *

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

              }

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

               *

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

              {

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

                      $fieldModelsList[$row['fieldname']] = $fieldModel;

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

              }

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

               *

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

                  }

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

                      $this->set('displaytype', $data['visibility']);

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

               * @return void

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

              }

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

              {

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

                  if (isset($this->items[$name])) {

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

                  $qualifiedModuleName = 'Settings:LayoutEditor';

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

                  switch ($name) {

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

                              'typeofdata' => 'V~O',

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

                          ];

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

                  }

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

                  while ($row = $dataReader->read()) {

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

                  return $fieldModelsList;

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

               * Get webservice data.

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

               *

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

               * @return Vtiger_Field_Model

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

               */

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

                  }

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

                      case 'icon':

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

                              'maximumlength' => '255',

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

               * @param <type> $module - optional - module instance

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

                  $dataReader = $query->createCommand()->query();

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

                  $dataReader->close();

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

               * @return void

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

                      $this->set('defaultvalue', $data['default_value']);

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

               *

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

                      $createCommand->update('w_#__fields_server', $data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->execute();

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

                  }

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

                              'name' => $name,

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

                              'column' => $name,

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

               */

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

              /** {@inheritdoc} */

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

              public function getFieldInfo(): array

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

               *

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

              {

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

                  if (isset($this->webserviceData)) {

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

                  return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];

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

                  if (empty($data['is_default'])) {

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

                  \App\Cache::delete('WebserviceAppsFields', $webserviceApp);

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

                              'label' => 'LBL_ICON',

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

                          break;

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

                              'label' => 'LBL_HEADER_FIELD',

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

                              'label' => 'LBL_MASS_EDIT',

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

                          $params = [

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

                      default:

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

                  return $itemModel;

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

                  return true;

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

              /**

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

               *

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

                  $fieldInfo['isQuickCreateDisabled'] = $this->isQuickCreateOptionDisabled();

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

                  $fieldInfo['isMassEditDisabled'] = $this->isMassEditOptionDisabled();

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

                  return $fieldInfo;

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

              public function loadWebserviceData(int $webserviceApp): void

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

                  } else {

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

                      case 'mandatory':

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

                          ];

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

                              'maximumlength' => '1',

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

                              'typeofdata' => 'C~O',

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

                      } elseif (($defaultValue = $itemModel->get('defaultvalue')) !== null) {

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

              public static function getInstance($value, $module = false)

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

                  return $fieldModel;

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

               * @return array

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

                  }

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

              public function updateWebserviceData(array $data, int $webserviceApp): void

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

              {

          Line exceeds 120 characters; contains 155 characters
          Open

                      $createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();

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

                  $itemModel = null;

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

                  }

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

              }

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

              /**

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

                      $fieldModel = new self();

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

                  $fieldInfo['isSummaryField'] = $this->isSummaryField();

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

                  $fieldInfo['isDefaultValueDisabled'] = $this->isDefaultValueOptionDisabled();

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

              }

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

              {

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

              }

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

               * @param string $name

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

                          $params = [

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

                              'column' => $name,

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

                          ];

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

                              'column' => $name,

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

                              'uitype' => 56,

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

                              'tooltip' => 'LBL_FIELD_MASK_INFO'

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

              }

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

                              'label' => 'LBL_LABEL',

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

                              'uitype' => 1,

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

                              'uitype' => 56,

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

                              'typeofdata' => 'C~O',

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

                              'maximumlength' => '1',

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

                              'purifyType' => \App\Purifier::BOOL

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

                              'typeofdata' => 'C~O',

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

                              'uitype' => 56,

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

                          break;

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

                              'maximumlength' => '25',

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

                              'uitype' => 56,

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

                          break;

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

                          break;

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

                          $params = [

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

                              'name' => $name,

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

                      case 'generatedtype':

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

                          $params = [

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

                              'typeofdata' => 'C~O',

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

                          $params = [

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

                              'typeofdata' => 'C~O',

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

                              'column' => $name,

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

                              'name' => $name,

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

                      case 'quickcreate':

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

                          $params = [

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

                              'uitype' => 56,

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

                              'maximumlength' => '1',

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

                              'uitype' => 56,

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

                              'maximumlength' => '1',

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

                          break;

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

                          break;

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

                          $itemModel->set('fieldvalue', $this->get($name));

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

                          $params = [

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

                              'label' => 'LBL_QUICK_CREATE',

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

                              'purifyType' => \App\Purifier::BOOL

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

                              'maximumlength' => '1',

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

                              'purifyType' => \App\Purifier::BOOL

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

                              'name' => $name,

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

                              'column' => $name,

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

                              'column' => $name,

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

                              'label' => 'LBL_FIELD_MASK',

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

                              'purifyType' => \App\Purifier::TEXT,

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

                              'typeofdata' => 'V~M',

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

                      case 'presence':

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

                              'name' => $name,

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

                          ];

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

                              'column' => $name,

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

                              'name' => $name,

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

                              'purifyType' => \App\Purifier::BOOL

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

                              'maximumlength' => '1',

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

                          break;

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

                              'column' => $name,

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

                          $params = [

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

                              'uitype' => 56,

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

                          ];

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

                              'name' => $name,

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

                  }

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

                      $itemModel = \Vtiger_Field_Model::init($qualifiedModuleName, $params, $name)->setSourceField($this);

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

                      if (null !== $this->get($name)) {

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

                              'maximumlength' => '50',

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

                          ];

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

                          $params = [

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

                              'name' => $name,

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

                      case 'header_field':

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

                              'typeofdata' => 'C~O',

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

                          ];

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

                      case 'fieldMask':

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

                          break;

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

                          $itemModel->set('fieldvalue', $defaultValue);

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

                              'label' => 'LBL_ACTIVE',

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

                              'typeofdata' => 'C~O',

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

                              'name' => $name,

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

                              'label' => 'LBL_DEFAULT_VALUE',

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

                              'uitype' => 56,

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

                              'purifyType' => \App\Purifier::BOOL

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

                          break;

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

                          break;

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

                              'purifyType' => \App\Purifier::BOOL

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

                              'label' => 'LBL_SUMMARY_FIELD',

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

                          ];

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

                              'purifyType' => \App\Purifier::BOOL,

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

                              'uitype' => 1,

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

                              'purifyType' => \App\Purifier::TEXT

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

                          ];

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

                              'maximumlength' => '1',

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

                          break;

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

                              'purifyType' => \App\Purifier::BOOL

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

                              'maximumlength' => '1',

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

                              'typeofdata' => 'V~O',

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

                          ];

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

                  if ($params) {

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

                  }

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

                              'label' => 'LBL_MANDATORY_FIELD',

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

                      case 'summaryfield':

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

                              'typeofdata' => 'C~O',

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

                      }

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

                          break;

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

                              'name' => $name,

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

                              'column' => $name,

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

                              'column' => $name,

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

                      case 'masseditable':

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

                              'label' => 'LBL_GENERATED_TYPE',

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

                              'isEditableReadOnly' => !App\Config::developer('CHANGE_GENERATEDTYPE')

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

                      case 'defaultvalue':

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

                          ];

          Class name "Settings_LayoutEditor_Field_Model" is not in camel caps format
          Open

          class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model

          Line indented incorrectly; expected 24 spaces, found 28
          Open

                                      }

          Line indented incorrectly; expected 20 spaces, found 24
          Open

                                  if (!$dataReader->count()) {

          Line indented incorrectly; expected 16 spaces, found 20
          Open

                              case 'mapCoordinates':

          Line indented incorrectly; expected 20 spaces, found 24
          Open

                                  }

          Line indented incorrectly; expected 24 spaces, found 28
          Open

                                      if ($db->isTableExists('vtiger_' . $fieldname . '_seq')) {

          There are no issues that match your filters.

          Category
          Status