YetiForceCompany/YetiForceCRM

View on GitHub
vtlib/Vtiger/Field.php

Summary

Maintainability
B
5 hrs
Test Coverage
D
65%

Method setPicklistValues has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setPicklistValues($values)
    {
        // Non-Role based picklist values
        if (16 === $this->uitype) {
            $this->setNoRolePicklistValues($values);
Severity: Minor
Found in vtlib/Vtiger/Field.php - About 1 hr to fix

    Method setNoRolePicklistValues has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function setNoRolePicklistValues($values)
        {
            $db = \App\Db::getInstance();
            $pickListNameIDs = ['recurring_frequency', 'payment_duration'];
            $picklistTable = 'vtiger_' . $this->name;
    Severity: Minor
    Found in vtlib/Vtiger/Field.php - About 1 hr to fix

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

          public function setPicklistValues($values)
          {
              // Non-Role based picklist values
              if (16 === $this->uitype) {
                  $this->setNoRolePicklistValues($values);
      Severity: Minor
      Found in vtlib/Vtiger/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

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

          public function setNoRolePicklistValues($values)
          {
              $db = \App\Db::getInstance();
              $pickListNameIDs = ['recurring_frequency', 'payment_duration'];
              $picklistTable = 'vtiger_' . $this->name;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          public static function deletePickLists($moduleInstance)
          {
              \App\Log::trace('Start', __METHOD__);
              $db = \App\Db::getInstance();
              $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => $moduleInstance->getId(), 'uitype' => [15, 16, 33]]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

              $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => $moduleInstance->getId(), 'uitype' => [15, 16, 33]]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

                  $query = (new \App\Db\Query())->select(['roleid'])->from('vtiger_role');
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

                  $importer = new \App\Db\Importers\Base();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

                  $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $picklistName])->scalar();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

          public static function getInstance($value, $moduleInstance = false)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

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

      Example

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

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

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

              $query = (new \App\Db\Query())
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

              $query = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_fieldmodulerel')->where(['relmodule' => $moduleInstance->name]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

                  $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['fieldname' => $modulePicklists, 'uitype' => [15, 16, 33]])
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

          public static function getAllForBlock($blockInstance, $moduleInstance = false)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

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

      Example

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

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

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

                  $rows = (new \App\Db\Query())->select(['vtiger_field.*', 's_#__fields_anonymization.*'])
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

                  $count = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $fieldId])->count();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '57', column '26').
      Open

                  $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $this->name])->scalar();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

                  $importer = new \App\Db\Importers\Base();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '155', column '21').
      Open

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\Picklist' in method 'getPicklistValues'.
      Open

              return \App\Fields\Picklist::getValuesName($this->name);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              } else {
                  $rows = (new \App\Db\Query())->select(['vtiger_field.*', 's_#__fields_anonymization.*'])
                      ->from('vtiger_field')
                      ->leftJoin('vtiger_blocks', 'vtiger_field.block = vtiger_blocks.blockid')
                      ->leftJoin('s_#__fields_anonymization', 'vtiger_field.fieldid = s_#__fields_anonymization.field_id')
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

              \App\Log::trace("Add tree template $tree->name ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              \App\Log::trace('End', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Db' in method 'unsetRelatedModules'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

          public static function getInstance($value, $moduleInstance = false)
          {
              $moduleId = $instance = false;
              if ($moduleInstance) {
                  $moduleId = $moduleInstance->id;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

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

      Example

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

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

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

              \App\Log::trace('Deleting fields of the module ... DONE', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Db' in method 'deletePickLists'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Db' in method 'setNoRolePicklistValues'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  \App\Cache::save('AllFieldForModule', $moduleId, $rows);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  \App\Log::trace("Creating table $picklistTable ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Db' in method 'setRelatedModules'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\Vtiger_Cache' in method 'getAllForBlock'.
      Open

              $cache = \Vtiger_Cache::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Db' in method 'deleteForModule'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              } else {
                  $query->where(['block' => $blockInstance->id]);
              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

                  $rows = \App\Cache::get('AllFieldForModule', $moduleId);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              \App\Log::trace('Start', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Field' in method 'getInstance'.
      Open

              if ($data = \App\Field::getFieldInfo($value, $moduleId)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  \App\Log::trace("Creating table $picklistTable ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\Picklist' in method 'setPicklistValues'.
      Open

              \App\Fields\Picklist::clearCache($this->name, $this->getModuleName());
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              \App\Log::trace('End', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Db' in method 'setPicklistValues'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\Picklist' in method 'setNoRolePicklistValues'.
      Open

              \App\Fields\Picklist::clearCache($this->name, $this->getModuleName());
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  \App\Log::trace("Setting $this->name relation with $moduleNames ... ERROR: No module names", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  \App\Log::trace("Setting $this->name relation with $checkRes ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  \App\Log::trace("Unsetting $this->name relation with $relmodule ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Db' in method 'setTreeTemplate'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              } else {
                  $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $this->name])->scalar();
              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

              if (\App\Cache::has('AllFieldForModule', $moduleId)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

              \App\Log::trace('Start', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "tabid" 5 times.
      Open

                  $query->where(['block' => $blockInstance->id, 'tabid' => $moduleInstance->id]);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "vtiger_fieldmodulerel" 6 times.
      Open

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $this->name])->scalar();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "fieldid" 5 times.
      Open

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                      'sortorderid' => $importer->smallInteger(5)->defaultValue(0),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                      'picklist_valueid' => $importer->integer(10)->defaultValue(0),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  $db->createCommand()->insert('vtiger_picklist', ['name' => $this->name])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                      'presence' => $importer->boolean()->defaultValue(true),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "vtiger_field" 5 times.
      Open

                  ->from('vtiger_field')
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

              if (\App\Cache::has('AllFieldForModule', $moduleId)) {
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

              $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => $moduleInstance->getId(), 'uitype' => [15, 16, 33]]);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  $db->createCommand()->createIndex("{$this->name}_valueid_idx", $picklistTable, 'picklist_valueid', true)->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()->insert($picklistTable, [$this->name => $value, 'presence' => $presence,
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  \App\Log::trace("Setting $this->name relation with $checkRes ... DONE", __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

          public static function getInstance($value, $moduleInstance = false)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()->insert('vtiger_trees_templates_data', ['templateid' => $templateId, 'name' => $treeValue->name, 'tree' => $treeValue->tree,
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              \App\Log::trace('End', __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()->insert('vtiger_picklist', ['name' => $this->name])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

           * @param array List of module names
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

      Suspicious array access to false
      Open

                  $instances[] = $instance;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

                      $db->createCommand()->dropTable("vtiger_$picklistName")->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                      'sortorderid' => $importer->smallInteger()->defaultValue(0),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $dbCommand = $db->createCommand();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $db->createCommand()->delete('vtiger_fieldmodulerel', ['or', "module = '$moduleInstance->name'", "relmodule = '$moduleInstance->name'"])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

           * @param array List of values to add
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

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

              if (\App\Cache::has('AllFieldForModule', $moduleId)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

                  $rows = (new \App\Db\Query())->select(['vtiger_field.*', 's_#__fields_anonymization.*'])
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $picklistName])->scalar();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

           * @param array List of module names
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()->delete('vtiger_fieldmodulerel', ['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $db->createCommand()->delete('a_#__encryption', ['target' => $moduleInstance->id])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              \App\Log::trace('Deleting fields of the module ... DONE', __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['fieldname' => $modulePicklists, 'uitype' => [15, 16, 33]])
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              \App\Log::trace("Add tree template $tree->name ... DONE", __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                      'presence' => $importer->boolean()->defaultValue(true),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $this->name])->scalar();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

      Reference to undeclared property \vtlib\Field->picklistValues (Did you mean $picklistValues)
      Open

                      $this->picklistValues[$value] = $value;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

           * @param Module Instance of module
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

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

              \App\Log::trace('Start', __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

           * @param array List of values to add
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

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

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

              $db->createCommand()->delete('vtiger_fieldmodulerel', ['or', "module = '$moduleInstance->name'", "relmodule = '$moduleInstance->name'"])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

           * @param Module Instance of module
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()->delete('vtiger_picklist', ['name' => $picklistName])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                      'sortorderid' => $importer->smallInteger(5)->defaultValue(0),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

      Reference to undeclared property \vtlib\Field->picklistValues (Did you mean $picklistValues)
      Open

                  if (isset($this->picklistValues)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

                  \App\Log::trace("Unsetting $this->name relation with $relmodule ... DONE", __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $query = (new \App\Db\Query())
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

      Expected an object instance when accessing an instance property, but saw an expression with type false
      Open

                  $instance->initialize($row, $moduleInstance->id, $blockInstance);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

      Expected an object instance when accessing an instance property, but saw an expression with type false
      Open

              $cache->setBlockFields($blockInstance->id, $moduleInstance->id, $instances);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $db->createCommand()->delete('vtiger_field', ['tabid' => $moduleInstance->id])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $query = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_fieldmodulerel')->where(['relmodule' => $moduleInstance->name]);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  \App\Log::trace("Creating table $picklistTable ... DONE", __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                      'presence' => $importer->boolean()->defaultValue(true),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

      Reference to undeclared property \vtlib\Field->picklistValues (Did you mean $picklistValues)
      Open

                  if (isset($this->picklistValues)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

      Reference to undeclared property \vtlib\Field->picklistValues (Did you mean $picklistValues)
      Open

                      $this->picklistValues[$value] = $value;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

              $db->createCommand()->insert('vtiger_trees_templates', ['name' => (string) $tree->name, 'tabid' => $moduleInstance->id, 'access' => $tree->access])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                      $db->createCommand()->dropTable("vtiger_{$picklistName}_seq")->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()->delete('vtiger_role2picklist', ['picklistid' => $picklistId])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $rows = \App\Cache::get('AllFieldForModule', $moduleId);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

      Returning type array<int>|array{}</int> but getAllForModule() is declared to return \vtlib\Field
      Open

              return $instances;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

              \App\Log::trace('Start', __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => $moduleInstance->getId(), 'uitype' => [15, 16, 33]]);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                      'picklist_valueid' => $importer->integer(10)->defaultValue(0),
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $db->createCommand()->insert('vtiger_fieldmodulerel', ['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->execute();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

      Saw possibly unextractable annotation for a fragment of comment '* @param vtlib\Block Instnace of block to use': after vtlib\Block, did not see an element name (will guess based on comment order)
      Open

           * @param vtlib\Block Instnace of block to use
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

      Saw possibly unextractable annotation for a fragment of comment '* @param Module Instance of module to which block is associated': after Module, did not see an element name (will guess based on comment order)
      Open

           * @param Module Instance of module to which block is associated
      Severity: Info
      Found in vtlib/Vtiger/Field.php by phan

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

                  \App\Log::trace("Creating table $picklistTable ... DONE", __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  \App\Log::trace("Setting $this->name relation with $moduleNames ... ERROR: No module names", __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  $query = (new \App\Db\Query())->select(['roleid'])->from('vtiger_role');
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

                  \App\Cache::save('AllFieldForModule', $moduleId, $rows);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phan

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

                  $count = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $fieldId])->count();
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              \App\Log::trace('End', __METHOD__);
      Severity: Critical
      Found in vtlib/Vtiger/Field.php by phan

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if (!$db->isTableExists($picklistTable)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $presence = 1; // 0 - readonly, Refer function in include/ComboUtil.php
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'presence' => 1,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public function getPicklistValues()
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Set values for picklist field (for all the roles).
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $values
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $picklistTable = 'vtiger_' . $this->name;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $picklistIdCol = $this->name . 'id';
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'picklist_valueid' => $importer->integer(10)->defaultValue(0),
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $this->picklistValues[$value] = $value;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'sortorderid' => $importer->smallInteger()->defaultValue(0),
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Set relation between field and modules (UIType 10).
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param array List of values to add
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $this->setNoRolePicklistValues($values);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->insert('vtiger_picklist', ['name' => $this->name])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 128 characters
      Open

                  $db->createCommand()->createIndex("{$this->name}_valueid_idx", $picklistTable, 'picklist_valueid', true)->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              // END
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public function setNoRolePicklistValues($values)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $picklistValues = $this->getPicklistValues();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if (\in_array($value, $picklistValues)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $newPicklistId = $db->getLastInsertID('vtiger_picklist_picklistid_seq');
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $insertedData[] = [$value, $newPicklistValueId, $newPicklistId, $sortid];
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $picklistIdCol = $this->name . 'id';
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $picklistIdCol = $this->name . '_id';
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if (!$db->isTableExists($picklistTable)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createTable($picklistTable, [
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $this->name => 'string',
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $sortId = \count($picklistValues) + 1;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $this->name => $value,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public function setRelatedModules($moduleNames)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if ($checkRes) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Get picklist values from table.
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'sortorderid' => $importer->smallInteger(5)->defaultValue(0),
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $data = [
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              // END
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              // Add value to picklist now
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              foreach ($values as $value) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      continue;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'sortorderid' => $sortId,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $this->picklistValues[$value] = $value;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @internal Creates table vtiger_fieldmodulerel if it does not exists
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if (16 === $this->uitype) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  return true;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      continue;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->insert($picklistTable, [$this->name => $value, 'presence' => $presence,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $newPicklistValueId = $db->getUniqueID('vtiger_picklistvalues');
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $values
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $dbCommand = $db->createCommand();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ];
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $this->name])->scalar();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $sortid = 0;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if (isset($this->picklistValues)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $picklistTable = 'vtiger_' . $this->name;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->createIndex("{$this->name}_valueid_idx", $picklistTable, 'picklist_valueid', true)->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  // Associate picklist values to all the role
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Fields\Picklist::clearCache($this->name, $this->getModuleName());
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              // Non-Role based picklist values
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'picklist_valueid' => $newPicklistValueId, 'sortorderid' => $sortid,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Fields\Picklist::clearCache($this->name, $this->getModuleName());
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param array List of values to add
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  \App\Log::trace("Setting $this->name relation with $moduleNames ... ERROR: No module names", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 180 characters
      Open

                  $checkRes = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->one();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              return \App\Fields\Picklist::getValuesName($this->name);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $picklistIdCol => 'pk',
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public function setPicklistValues($values)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'presence' => $importer->boolean()->defaultValue(true),
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if (\in_array($value, $picklistValues)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ++$sortid;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $roleIds = $query->column();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $query = (new \App\Db\Query())->select(['roleid'])->from('vtiger_role');
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Set values for picklist field (non-role based).
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 123 characters
      Open

                      ->batchInsert('vtiger_role2picklist', ['roleid', 'picklistvalueid', 'picklistid', 'sortid'], $insertedData)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $pickListNameIDs = ['recurring_frequency', 'payment_duration'];
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'presence' => $importer->boolean()->defaultValue(true),
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if (\in_array($this->name, $pickListNameIDs)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  \App\Log::trace("Creating table $picklistTable ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $dbCommand->insert($picklistTable, $data)->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $moduleNames
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if (isset($this->picklistValues)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  // If relation already exist continue
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createTable($picklistTable, [
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $picklistValues = $this->getPicklistValues();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->batchInsert('vtiger_role2picklist', ['roleid', 'picklistvalueid', 'picklistid', 'sortid'], $insertedData)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $importer = new \App\Db\Importers\Base();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $picklistIdCol => 'pk',
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if (0 == \count($moduleNames)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $importer = new \App\Db\Importers\Base();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $this->name => 'string',
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 142 characters
      Open

                  $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $this->name])->scalar();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              foreach ($values as $value) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $insertedData = [];
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ++$sortId;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param array List of module names
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              foreach ($moduleNames as &$relmodule) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  \App\Log::trace("Creating table $picklistTable ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              } else {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  foreach ($roleIds as $value) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  return false;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @return \vtlib\Field|bool
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $moduleId = $instance = false;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $moduleId = $moduleInstance->id;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->where(['vtiger_field.tabid' => $moduleId])
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              self::deleteUiType10Fields($moduleInstance);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              foreach ($tree->tree_values->tree_value as $treeValue) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->insert('vtiger_trees_templates_data', ['templateid' => $templateId, 'name' => $treeValue->name, 'tree' => $treeValue->tree,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              return true;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public static function getAllForBlock($blockInstance, $moduleInstance = false)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              foreach ($rows as $row) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              return $instances;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param ModuleBasic $moduleInstance
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public function setTreeTemplate($tree, $moduleInstance)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              return $instances;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->orderBy(['vtiger_blocks.sequence' => SORT_ASC, 'vtiger_field.sequence' => SORT_ASC])
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  \App\Cache::save('AllFieldForModule', $moduleId, $rows);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              self::deletePickLists($moduleInstance);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db->createCommand()->delete('a_#__encryption', ['target' => $moduleInstance->id])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Log::trace('Start', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $modulePicklists = array_diff($modulePicklists, $picklists);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instances[] = $instance;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Delete fields associated with the module.
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param Module Instance of module
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Function to remove picklist-type or multiple choice picklist-type table.
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['fieldname' => $modulePicklists, 'uitype' => [15, 16, 33]])
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public function unsetRelatedModules($moduleNames)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $moduleId = $moduleInstance->id;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if ($moduleInstance && $cache->getBlockFields($blockInstance->id, $moduleInstance->id)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public static function getAllForModule(ModuleBasic $moduleInstance)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Log::trace('Deleting fields of the module ... DONE', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public static function deletePickLists($moduleInstance)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => $moduleInstance->getId(), 'uitype' => [15, 16, 33]]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $db->createCommand()->dropTable("vtiger_{$picklistName}_seq")->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  \App\Log::trace("Unsetting $this->name relation with $relmodule ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $blockInstance
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $cache = \Vtiger_Cache::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $query->where(['block' => $blockInstance->id, 'tabid' => $moduleInstance->id]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              } else {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $rows = (new \App\Db\Query())->select(['vtiger_field.*', 's_#__fields_anonymization.*'])
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $instances = [];
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instances[] = $instance;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db->createCommand()->delete('vtiger_field', ['tabid' => $moduleInstance->id])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 167 characters
      Open

              $db->createCommand()->insert('vtiger_trees_templates', ['name' => (string) $tree->name, 'tabid' => $moduleInstance->id, 'access' => $tree->access])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 157 characters
      Open

                  $db->createCommand()->insert('vtiger_trees_templates_data', ['templateid' => $templateId, 'name' => $treeValue->name, 'tree' => $treeValue->tree,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      'parentTree' => $treeValue->parentTree, 'depth' => $treeValue->depth, 'label' => $treeValue->label, 'state' => $treeValue->state,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Function to remove uitype10 fields.
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 156 characters
      Open

              $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => $moduleInstance->getId(), 'uitype' => [15, 16, 33]]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if (!empty($modulePicklists)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if ($db->isTableExists("vtiger_{$picklistName}_seq")) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      continue;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $templateId = $db->getLastInsertID('vtiger_trees_templates_templateid_seq');
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if ($db->isTableExists("vtiger_$picklistName")) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              foreach ($moduleNames as &$relmodule) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $instances = false;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ->orderBy('sequence');
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 156 characters
      Open

              $db->createCommand()->delete('vtiger_fieldmodulerel', ['or', "module = '$moduleInstance->name'", "relmodule = '$moduleInstance->name'"])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Log::trace("Add tree template $tree->name ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              while ($fieldId = $dataReader->readColumn(0)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $field = self::getInstance($fieldId, $moduleInstance);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $field->delete();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param Module Instance of module
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->delete('vtiger_role2picklist', ['picklistid' => $picklistId])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Remove relation between the field and modules (UIType 10).
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 166 characters
      Open

                  $db->createCommand()->delete('vtiger_fieldmodulerel', ['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param Module Instance of module to which block is associated
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ->from('vtiger_field')
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instance->initialize($row, $moduleInstance->id, $blockInstance);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->leftJoin('s_#__fields_anonymization', 'vtiger_field.fieldid = s_#__fields_anonymization.field_id')
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 138 characters
      Open

              $query = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_fieldmodulerel')->where(['relmodule' => $moduleInstance->name]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 141 characters
      Open

                  $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $picklistName])->scalar();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Log::trace('End', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $moduleNames
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instance->initialize($data, $moduleId);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param vtlib\Block Instnace of block to use
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  return $cache->getBlockFields($blockInstance->id, $moduleInstance->id);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $cache->setBlockFields($blockInstance->id, $moduleInstance->id, $instances);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param ModuleBasic $moduleInstance
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->from('vtiger_field')
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public static function deleteForModule(ModuleBasic $moduleInstance)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Log::trace('Start', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  if (1 === (int) $count) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $moduleInstance
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->insert('vtiger_fieldmodulerel', ['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 166 characters
      Open

                  $db->createCommand()->insert('vtiger_fieldmodulerel', ['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  \App\Log::trace("Setting $this->name relation with $checkRes ... DONE", __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Get Field instances related to block.
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              while ($row = $dataReader->read()) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @return self
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instance->initialize($row, $moduleId);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $dataReader = $query->createCommand()->query();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $picklists = $query->column();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              foreach ($modulePicklists as &$picklistName) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->delete('vtiger_fieldmodulerel', ['fieldid' => $this->id, 'module' => $this->getModuleName(), 'relmodule' => $relmodule])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public static function getInstance($value, $moduleInstance = false)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if ($moduleInstance) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instance = new self();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $dataReader = $query->createCommand()->query();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $moduleInstance
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 155 characters
      Open

                  $query = (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['fieldname' => $modulePicklists, 'uitype' => [15, 16, 33]])
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param array List of module names
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param string|int    $value          mixed fieldid or fieldname
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              return $instance;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ->leftJoin('s_#__fields_anonymization', 'vtiger_field.fieldid = s_#__fields_anonymization.field_id')
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if ($moduleInstance) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              } else {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db->createCommand()->insert('vtiger_trees_templates', ['name' => (string) $tree->name, 'tabid' => $moduleInstance->id, 'access' => $tree->access])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          public static function deleteUiType10Fields($moduleInstance)
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $modulePicklists = $query->column();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              return true;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param \vtlib\Module $moduleInstance Instance of the module if fieldname is used
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * @param mixed $moduleInstance
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $query = (new \App\Db\Query())
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Get Field instances related to module.
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      Line exceeds 120 characters; contains 145 characters
      Open

                      'parentTree' => $treeValue->parentTree, 'depth' => $treeValue->depth, 'label' => $treeValue->label, 'state' => $treeValue->state,
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->andWhere(['<>', 'tabid', $moduleInstance->getId()]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      $db->createCommand()->dropTable("vtiger_$picklistName")->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $picklistName])->scalar();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

           * Get Field instance by fieldid or fieldname.
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $query->where(['block' => $blockInstance->id]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $rows = \App\Cache::get('AllFieldForModule', $moduleId);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->leftJoin('vtiger_blocks', 'vtiger_field.block = vtiger_blocks.blockid')
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $query = (new \App\Db\Query())->select(['fieldid'])->from('vtiger_fieldmodulerel')->where(['relmodule' => $moduleInstance->name]);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $count = (new \App\Db\Query())->from('vtiger_fieldmodulerel')->where(['fieldid' => $fieldId])->count();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $db->createCommand()->delete('vtiger_picklist', ['name' => $picklistName])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if ($data = \App\Field::getFieldInfo($value, $moduleId)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instance = new self();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              if (\App\Cache::has('AllFieldForModule', $moduleId)) {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                      ->all();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  $instance = new self();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              $db->createCommand()->delete('vtiger_fieldmodulerel', ['or', "module = '$moduleInstance->name'", "relmodule = '$moduleInstance->name'"])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

                  ])->execute();
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              return $templateId;
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

              \App\Log::trace('End', __METHOD__);
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in vtlib/Vtiger/Field.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status