YetiForceCompany/YetiForceCRM

View on GitHub
app/Field.php

Summary

Maintainability
D
3 days
Test Coverage
B
83%

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

<?php

namespace App;

/**
Severity: Minor
Found in app/Field.php - About 4 hrs to fix

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

    class Field
    {
        /** @var string[] Help info views. */
        const HELP_INFO_VIEWS = ['LBL_EDIT_VIEW' => 'Edit', 'LBL_DETAIL_VIEW' => 'Detail', 'LBL_QUICK_CREATE_VIEW' => 'QuickCreateAjax'];
    
    
    Severity: Minor
    Found in app/Field.php by phpmd

    Function getRelatedFieldForModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
        {
            $key = 'all';
            if (Cache::has('getRelatedFieldForModule', $key)) {
                $fields = Cache::get('getRelatedFieldForModule', $key);
    Severity: Minor
    Found in app/Field.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method getRelatedFieldForModule has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
        {
            $key = 'all';
            if (Cache::has('getRelatedFieldForModule', $key)) {
                $fields = Cache::get('getRelatedFieldForModule', $key);
    Severity: Major
    Found in app/Field.php - About 2 hrs to fix

      Function getFieldPermission has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
          {
              $tabId = $tabMix;
              if (!is_numeric($tabMix)) {
                  $tabId = Module::getModuleId($tabMix);
      Severity: Minor
      Found in app/Field.php - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method getFieldsPermissions has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getFieldsPermissions($tabId, $readOnly = true)
          {
              Log::trace('Entering ' . __METHOD__ . ": $tabId");
              if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
                  $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
      Severity: Minor
      Found in app/Field.php - About 1 hr to fix

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

            public static function getFieldsPermissions($tabId, $readOnly = true)
            {
                Log::trace('Entering ' . __METHOD__ . ": $tabId");
                if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
                    $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
        Severity: Minor
        Found in app/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 getColumnPermission has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
            {
                $tabId = $tabMix;
                if (!is_numeric($tabMix)) {
                    $tabId = Module::getModuleId($tabMix);
        Severity: Minor
        Found in app/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

        Method getFieldPermission has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
            {
                $tabId = $tabMix;
                if (!is_numeric($tabMix)) {
                    $tabId = Module::getModuleId($tabMix);
        Severity: Minor
        Found in app/Field.php - About 1 hr to fix

          Method getColumnPermission has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
              {
                  $tabId = $tabMix;
                  if (!is_numeric($tabMix)) {
                      $tabId = Module::getModuleId($tabMix);
          Severity: Minor
          Found in app/Field.php - About 1 hr to fix

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

                public static function checkQuickChangerConditions(array $field, \Vtiger_Record_Model $recordModel)
                {
                    $return = false;
                    foreach ($field['conditions'] as $fieldName => $value) {
                        if ($recordModel->get($fieldName) !== $value) {
            Severity: Minor
            Found in app/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 getFieldInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getFieldInfo($mixed, $module = false)
                {
                    $fieldInfo = false;
                    if (is_numeric($mixed)) {
                        if (Cache::has('FieldInfoById', $mixed)) {
            Severity: Minor
            Found in app/Field.php - About 35 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

            Avoid too many return statements within this method.
            Open

                    return $fields;
            Severity: Major
            Found in app/Field.php - About 30 mins to fix

              The method getFieldPermission() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
              Open

                  public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
                  {
                      $tabId = $tabMix;
                      if (!is_numeric($tabMix)) {
                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/Field.php by phpmd

              NPathComplexity

              Since: 0.1

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

              Example

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

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

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

                  public static function getFieldsPermissions($tabId, $readOnly = true)
                  {
                      Log::trace('Entering ' . __METHOD__ . ": $tabId");
                      if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
                          $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
              Severity: Minor
              Found in app/Field.php by phpmd

              CyclomaticComplexity

              Since: 0.1

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

              Example

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

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

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

                  public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
                  {
                      $tabId = $tabMix;
                      if (!is_numeric($tabMix)) {
                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/Field.php by phpmd

              CyclomaticComplexity

              Since: 0.1

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

              Example

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

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

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

                  public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
                  {
                      $tabId = $tabMix;
                      if (!is_numeric($tabMix)) {
                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/Field.php by phpmd

              CyclomaticComplexity

              Since: 0.1

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

              Example

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

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

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

                  public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
                  {
                      $key = 'all';
                      if (Cache::has('getRelatedFieldForModule', $key)) {
                          $fields = Cache::get('getRelatedFieldForModule', $key);
              Severity: Minor
              Found in app/Field.php by phpmd

              CyclomaticComplexity

              Since: 0.1

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

              Example

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

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

              Reduce the number of returns of this function 5, down to the maximum allowed 3.
              Open

                  public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
              Severity: Major
              Found in app/Field.php by sonar-php

              Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

              Noncompliant Code Example

              With the default threshold of 3:

              function myFunction(){ // Noncompliant as there are 4 return statements
                if (condition1) {
                  return true;
                } else {
                  if (condition2) {
                    return false;
                  } else {
                    return true;
                  }
                }
                return false;
              }
              

              Reduce the number of returns of this function 4, down to the maximum allowed 3.
              Open

                  public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
              Severity: Major
              Found in app/Field.php by sonar-php

              Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

              Noncompliant Code Example

              With the default threshold of 3:

              function myFunction(){ // Noncompliant as there are 4 return statements
                if (condition1) {
                  return true;
                } else {
                  if (condition2) {
                    return false;
                  } else {
                    return true;
                  }
                }
                return false;
              }
              

              Reduce the number of returns of this function 4, down to the maximum allowed 3.
              Open

                  public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
              Severity: Major
              Found in app/Field.php by sonar-php

              Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

              Noncompliant Code Example

              With the default threshold of 3:

              function myFunction(){ // Noncompliant as there are 4 return statements
                if (condition1) {
                  return true;
                } else {
                  if (condition2) {
                    return false;
                  } else {
                    return true;
                  }
                }
                return false;
              }
              

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

                  public static function getFieldsPermissions($tabId, $readOnly = true)
              Severity: Critical
              Found in app/Field.php by sonar-php

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

              See

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

                  public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
              Severity: Critical
              Found in app/Field.php by sonar-php

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

              See

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

                  public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
              Severity: Critical
              Found in app/Field.php by sonar-php

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

              See

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

                          $query = (new \App\Db\Query())
              Severity: Minor
              Found in app/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 getFieldPermission has a boolean flag argument $readOnly, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
              Severity: Minor
              Found in app/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

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

                  public static function getFieldsPermissions($tabId, $readOnly = true)
              Severity: Minor
              Found in app/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 '239', column '293').
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Minor
              Found in app/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 '245', column '297').
              Open

                          $fmrQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_fieldmodulerel.relmodule', 'type' => new \yii\db\Expression($db->quoteValue(1))])
              Severity: Minor
              Found in app/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 '329', column '22').
              Open

                          $fieldInfo = (new \App\Db\Query())
              Severity: Minor
              Found in app/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 getColumnPermission has a boolean flag argument $readOnly, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
              Severity: Minor
              Found in app/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

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

                  public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
              Severity: Minor
              Found in app/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

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

                  public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
              Severity: Minor
              Found in app/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

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

                  public static function getModuleFieldInfos($module, bool $returnByColumn = false): array
              Severity: Minor
              Found in app/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

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

                  public static function getFieldInfo($mixed, $module = false)
              Severity: Minor
              Found in app/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 '305', column '19').
              Open

                          $fields = (new \App\Db\Query())->select(['vtiger_relatedlists_fields.fieldid', 'vtiger_field.fieldname'])->from('vtiger_relatedlists_fields')
              Severity: Minor
              Found in app/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\Cache' in method 'getFieldsPermissions'.
              Open

                          Cache::save(__METHOD__ . User::getCurrentUserId(), $tabId, $fields);
              Severity: Minor
              Found in app/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 getFieldsPermissions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $query = (new \App\Db\Query())
                              ->select([
                                  'vtiger_field.fieldid',
                                  'vtiger_field.fieldname',
              Severity: Minor
              Found in app/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

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

                      } else {
                          self::$fieldPermissionCacheWrite[$tabId][$fieldMix] = false;
                      }
              Severity: Minor
              Found in app/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 'getFieldsPermissions'.
              Open

                      if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
              Severity: Minor
              Found in app/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 getFieldPermission uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                              } else {
                                  self::$fieldPermissionCacheWrite[$tabId][$fieldMix] = $permission;
                                  self::$columnPermissionCacheWrite[$tabId][$field['columnname']] = $permission;
                              }
              Severity: Minor
              Found in app/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 'getFieldPermission'.
              Open

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

                      } else {
                          $key = 'fieldname';
                      }
              Severity: Minor
              Found in app/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\User' in method 'getFieldsPermissions'.
              Open

                          Cache::save(__METHOD__ . User::getCurrentUserId(), $tabId, $fields);
              Severity: Minor
              Found in app/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\User' in method 'getFieldsPermissions'.
              Open

                      if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
              Severity: Minor
              Found in app/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\User' in method 'getFieldsPermissions'.
              Open

                          $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
              Severity: Minor
              Found in app/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\Module' in method 'getFieldPermission'.
              Open

                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/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 'getFieldsPermissions'.
              Open

                          $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
              Severity: Minor
              Found in app/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 'getFieldsPermissions'.
              Open

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

                      } else {
                          self::$columnPermissionCacheWrite[$tabId][$columnName] = false;
                      }
              Severity: Minor
              Found in app/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 'getRelatedFieldForModule'.
              Open

                          $fields = Cache::get('getRelatedFieldForModule', $key);
              Severity: Minor
              Found in app/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 getFieldInfo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $fieldsInfo = self::getModuleFieldInfos($module);
                          if ($fieldsInfo && isset($fieldsInfo[$mixed])) {
                              $fieldInfo = $fieldsInfo[$mixed];
                              Cache::save('FieldInfoById', $fieldInfo['fieldid'], $fieldInfo, Cache::LONG);
              Severity: Minor
              Found in app/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 'getModuleFieldInfos'.
              Open

                          Cache::save('ModuleFieldInfosByColumn', $module, $fieldInfoByColumn);
              Severity: Minor
              Found in app/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 'getFieldsTypeFromUIType'.
              Open

                      Cache::save('getFieldsTypeFromUIType', '', $fieldTypeMapping, Cache::LONG);
              Severity: Minor
              Found in app/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\Language' in method 'getCustomListForDefaultValue'.
              Open

                              'accountLoggedContact' => \App\Language::translate('LBL_ACCOUNT_LOGGED_CONTACT', 'Settings:LayoutEditor'),
              Severity: Minor
              Found in app/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\Language' in method 'getCustomListForDefaultValue'.
              Open

                              'loggedContact' => \App\Language::translate('LBL_LOGGED_CONTACT', 'Settings:LayoutEditor'),
              Severity: Minor
              Found in app/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 getRelatedFieldForModule uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $db = Db::getInstance();
                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
                              ->from('vtiger_field')
                              ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')
              Severity: Minor
              Found in app/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\Module' in method 'getModuleFieldInfos'.
              Open

                          $module = Module::getModuleName($module);
              Severity: Minor
              Found in app/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\ModuleHierarchy' in method 'getRelatedFieldForModule'.
              Open

                              foreach (ModuleHierarchy::getModulesByUitype($row['uitype']) as $module => $value) {
              Severity: Minor
              Found in app/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\Json' in method 'getQuickChangerFields'.
              Open

                          $row['values'] = Json::decode($row['values']);
              Severity: Minor
              Found in app/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 'getFieldsFromRelation'.
              Open

                          Cache::save('getFieldsFromRelation', $relationId, $fields, Cache::LONG);
              Severity: Minor
              Found in app/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 'getQuickChangerFields'.
              Open

                      Cache::save('getQuickChangerFields', $tabId, $rows, Cache::LONG);
              Severity: Minor
              Found in app/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 'getFieldInfo'.
              Open

                              return Cache::get('FieldInfoById', $mixed);
              Severity: Minor
              Found in app/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 'getModuleFieldInfos'.
              Open

                      return Cache::get($cacheName, $module);
              Severity: Minor
              Found in app/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\Module' in method 'getModuleFieldInfos'.
              Open

                              ->where(['tabid' => Module::getModuleId($module)])
              Severity: Minor
              Found in app/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 'getFieldsFromRelation'.
              Open

                          $fields = Cache::get('getFieldsFromRelation', $relationId);
              Severity: Minor
              Found in app/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 'getFieldInfo'.
              Open

                              Cache::save('FieldInfoById', $fieldInfo['fieldid'], $fieldInfo, Cache::LONG);
              Severity: Minor
              Found in app/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\Module' in method 'getColumnPermission'.
              Open

                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/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 'getRelatedFieldForModule'.
              Open

                      if (Cache::has('getRelatedFieldForModule', $key)) {
              Severity: Minor
              Found in app/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 'getRelatedFieldForModule'.
              Open

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

                          Cache::save('FieldInfoById', $mixed, $fieldInfo, Cache::LONG);
              Severity: Minor
              Found in app/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 'getModuleFieldInfos'.
              Open

                          Cache::save($cacheName, $module, $fieldInfoByName);
              Severity: Minor
              Found in app/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 getFieldsFromRelation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          $fields = (new \App\Db\Query())->select(['vtiger_relatedlists_fields.fieldid', 'vtiger_field.fieldname'])->from('vtiger_relatedlists_fields')
                              ->innerJoin('vtiger_field', 'vtiger_field.fieldid = vtiger_relatedlists_fields.fieldid')
                              ->where(['relation_id' => $relationId, 'vtiger_field.presence' => [0, 2]])->orderBy(['vtiger_relatedlists_fields.relation_id' => SORT_ASC, 'vtiger_relatedlists_fields.sequence' => SORT_ASC])
                              ->createCommand()->queryAllByGroup();
              Severity: Minor
              Found in app/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 'getFieldInfo'.
              Open

                          if (Cache::has('FieldInfoById', $mixed)) {
              Severity: Minor
              Found in app/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 'getColumnPermission'.
              Open

                      Log::trace('Entering ' . __METHOD__ . ": $tabId,$columnName");
              Severity: Minor
              Found in app/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 'getFieldsFromRelation'.
              Open

                      if (Cache::has('getFieldsFromRelation', $relationId)) {
              Severity: Minor
              Found in app/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 'getModuleFieldInfos'.
              Open

                      if (!Cache::has($cacheName, $module)) {
              Severity: Minor
              Found in app/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 'getQuickChangerFields'.
              Open

                      if (Cache::has('getQuickChangerFields', $tabId)) {
              Severity: Minor
              Found in app/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\Json' in method 'getQuickChangerFields'.
              Open

                          $row['conditions'] = Json::decode($row['conditions']);
              Severity: Minor
              Found in app/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\Language' in method 'getCustomListForDefaultValue'.
              Open

                              'accountOnContact' => \App\Language::translate('LBL_ACCOUNT_ON_CONTACT', 'Settings:LayoutEditor'),
              Severity: Minor
              Found in app/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 getColumnPermission uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                              } else {
                                  self::$columnPermissionCacheWrite[$tabId][$columnName] = $permission;
                                  self::$fieldPermissionCacheWrite[$tabId][$field['fieldname']] = $permission;
                              }
              Severity: Minor
              Found in app/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 'getRelatedFieldForModule'.
              Open

                          Cache::save('getRelatedFieldForModule', $key, $fields, Cache::LONG);
              Severity: Minor
              Found in app/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 'getModuleFieldInfos'.
              Open

                          return Cache::get('ModuleFieldInfosByColumn', $module);
              Severity: Minor
              Found in app/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 'getFieldsTypeFromUIType'.
              Open

                      if (Cache::has('getFieldsTypeFromUIType', '')) {
              Severity: Minor
              Found in app/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 'getQuickChangerFields'.
              Open

                          return Cache::get('getQuickChangerFields', $tabId);
              Severity: Minor
              Found in app/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 'getFieldsTypeFromUIType'.
              Open

                          return Cache::get('getFieldsTypeFromUIType', '');
              Severity: Minor
              Found in app/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 "maximumlength" 8 times.
              Open

                          'uitype' => 53,    'typeofdata' => 'V~M',    'maximumlength' => 65535,
              Severity: Critical
              Found in app/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" 8 times.
              Open

                              if (isset($fields[$row['fieldname']])) {
              Severity: Critical
              Found in app/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_tab.name" 3 times.
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/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 "columntype" 3 times.
              Open

                          'uitype' => 120,    'typeofdata' => 'V~O',    'columntype' => 'int(11)', 'maximumlength' => 65535,
              Severity: Critical
              Found in app/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 "getFieldsFromRelation" 3 times.
              Open

                      if (Cache::has('getFieldsFromRelation', $relationId)) {
              Severity: Critical
              Found in app/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.fieldlabel" 3 times.
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/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.fieldname" 5 times.
              Open

                                  'vtiger_field.fieldname',
              Severity: Critical
              Found in app/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.tabid" 4 times.
              Open

                                  'vtiger_field.tabid' => (int) $tabId,
              Severity: Critical
              Found in app/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 "displaytype" 4 times.
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Critical
              Found in app/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 "values" 3 times.
              Open

                          $row['values'] = Json::decode($row['values']);
              Severity: Critical
              Found in app/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 "getRelatedFieldForModule" 3 times.
              Open

                      if (Cache::has('getRelatedFieldForModule', $key)) {
              Severity: Critical
              Found in app/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 "modifiedtime" 3 times.
              Open

                      'modifiedtime' => [
              Severity: Critical
              Found in app/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 "validationConditions" 8 times.
              Open

                          'validationConditions' => ['name'],
              Severity: Critical
              Found in app/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 "private" 3 times.
              Open

                      'private' => [
              Severity: Critical
              Found in app/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_crmentity" 7 times.
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Critical
              Found in app/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.tabid = vtiger_tab.tabid" 3 times.
              Open

                              ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')
              Severity: Critical
              Found in app/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 "modifiedby" 3 times.
              Open

                      'modifiedby' => [
              Severity: Critical
              Found in app/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 "Entering " 3 times.
              Open

                      Log::trace('Entering ' . __METHOD__ . ": $tabId");
              Severity: Critical
              Found in app/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.columnname" 4 times.
              Open

                                  'vtiger_field.columnname',
              Severity: Critical
              Found in app/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 "visible" 6 times.
              Open

                                  $row['visible'] = $old['visible'] > 0 ? $row['visible'] : $old['visible'];
              Severity: Critical
              Found in app/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 "table" 7 times.
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Critical
              Found in app/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 "conditions" 3 times.
              Open

                          $row['conditions'] = Json::decode($row['conditions']);
              Severity: Critical
              Found in app/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_tab" 3 times.
              Open

                              ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')
              Severity: Critical
              Found in app/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.tablename" 3 times.
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/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.uitype" 4 times.
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/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_tab.presence" 3 times.
              Open

                              ->where(['vtiger_tab.presence' => 0]);
              Severity: Critical
              Found in app/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 "getQuickChangerFields" 3 times.
              Open

                      if (Cache::has('getQuickChangerFields', $tabId)) {
              Severity: Critical
              Found in app/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 "columnname" 4 times.
              Open

                                  self::$columnPermissionCacheRead[$tabId][$field['columnname']] = $permission;
              Severity: Critical
              Found in app/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 "createdtime" 3 times.
              Open

                      'createdtime' => [
              Severity: Critical
              Found in app/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 "readonly" 5 times.
              Open

                                  $row['readonly'] = $old['readonly'] > 0 ? $row['readonly'] : $old['readonly'];
              Severity: Critical
              Found in app/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 "shownerid" 3 times.
              Open

                      'shownerid' => [
              Severity: Critical
              Found in app/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 "Settings:LayoutEditor" 3 times.
              Open

                              'loggedContact' => \App\Language::translate('LBL_LOGGED_CONTACT', 'Settings:LayoutEditor'),
              Severity: Critical
              Found in app/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 "share_externally" 3 times.
              Open

                      'share_externally' => [
              Severity: Critical
              Found in app/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 "label" 8 times.
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Critical
              Found in app/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 "column" 9 times.
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Critical
              Found in app/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 "typeofdata" 8 times.
              Open

                          'uitype' => 53,    'typeofdata' => 'V~M',    'maximumlength' => 65535,
              Severity: Critical
              Found in app/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.fieldid" 5 times.
              Open

                                  'vtiger_field.fieldid',
              Severity: Critical
              Found in app/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" 7 times.
              Open

                              ->from('vtiger_field')
              Severity: Critical
              Found in app/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 "FieldInfoById" 4 times.
              Open

                          if (Cache::has('FieldInfoById', $mixed)) {
              Severity: Critical
              Found in app/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 "relmod" 5 times.
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/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 "uitype" 11 times.
              Open

                          'uitype' => 53,    'typeofdata' => 'V~M',    'maximumlength' => 65535,
              Severity: Critical
              Found in app/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 "getFieldsTypeFromUIType" 3 times.
              Open

                      if (Cache::has('getFieldsTypeFromUIType', '')) {
              Severity: Critical
              Found in app/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.

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

                              foreach (ModuleHierarchy::getModulesByUitype($row['uitype']) as $module => $value) {
              Severity: Minor
              Found in app/Field.php by phpmd

              UnusedLocalVariable

              Since: 0.2

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

              Example

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

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

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

                          $fmrQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_fieldmodulerel.relmodule', 'type' => new \yii\db\Expression($db->quoteValue(1))])
              Severity: Critical
              Found in app/Field.php by phan

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

                          $fields = Cache::get('getFieldsFromRelation', $relationId);
              Severity: Minor
              Found in app/Field.php by phan

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

                          $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
              Severity: Minor
              Found in app/Field.php by phan

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

                      Log::trace('Entering ' . __METHOD__ . ": $tabId,$columnName");
              Severity: Critical
              Found in app/Field.php by phan

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

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/Field.php by phan

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

                      if (Cache::has('getFieldsFromRelation', $relationId)) {
              Severity: Minor
              Found in app/Field.php by phan

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

                      if (Cache::has('getQuickChangerFields', $tabId)) {
              Severity: Minor
              Found in app/Field.php by phan

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

                          Cache::save(__METHOD__ . User::getCurrentUserId(), $tabId, $fields);
              Severity: Minor
              Found in app/Field.php by phan

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

                      $dataReader = (new Db\Query())->from('s_#__record_quick_changer')->where(['tabid' => $tabId])->createCommand()->query();
              Severity: Critical
              Found in app/Field.php by phan

              Returning type bool but checkQuickChangerConditions() is declared to return void
              Open

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

              Default value for \App\type $readOnly can't be true
              Open

                  public static function getFieldsPermissions($tabId, $readOnly = true)
              Severity: Minor
              Found in app/Field.php by phan

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

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

              Parameter $readOnly has undeclared type \App\type
              Open

                  public static function getFieldsPermissions($tabId, $readOnly = true)
              Severity: Minor
              Found in app/Field.php by phan

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

                          $fields = (new \App\Db\Query())->select(['vtiger_relatedlists_fields.fieldid', 'vtiger_field.fieldname'])->from('vtiger_relatedlists_fields')
              Severity: Critical
              Found in app/Field.php by phan

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

                          $query = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name'])
              Severity: Critical
              Found in app/Field.php by phan

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

                      $fieldTypeMapping = (new Db\Query())->from('vtiger_ws_fieldtype')->indexBy('uitype')->all();
              Severity: Critical
              Found in app/Field.php by phan

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

                          return Cache::get('getQuickChangerFields', $tabId);
              Severity: Minor
              Found in app/Field.php by phan

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

                      Log::trace('Entering ' . __METHOD__ . ": $tabId");
              Severity: Critical
              Found in app/Field.php by phan

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

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/Field.php by phan

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

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Critical
              Found in app/Field.php by phan

              Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
              Open

                          Cache::save(__METHOD__ . User::getCurrentUserId(), $tabId, $fields);
              Severity: Critical
              Found in app/Field.php by phan

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

                      Cache::save('getQuickChangerFields', $tabId, $rows, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phan

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

                      Log::trace('Entering ' . __METHOD__ . ": $tabId,$fieldMix");
              Severity: Critical
              Found in app/Field.php by phan

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

                          $fmrQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_fieldmodulerel.relmodule', 'type' => new \yii\db\Expression($db->quoteValue(1))])
              Severity: Critical
              Found in app/Field.php by phan

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

                      if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
              Severity: Minor
              Found in app/Field.php by phan

              Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
              Open

                          $profileList = \App\User::getCurrentUserModel()->getProfiles();
              Severity: Critical
              Found in app/Field.php by phan

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

                          Cache::save('getFieldsFromRelation', $relationId, $fields, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phan

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

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

              Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
              Open

                      if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
              Severity: Critical
              Found in app/Field.php by phan

              Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
              Open

                          $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
              Severity: Critical
              Found in app/Field.php by phan

              Default value for int|string $module can't be false
              Open

                  public static function getFieldInfo($mixed, $module = false)
              Severity: Minor
              Found in app/Field.php by phan

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

                          $fmrQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_fieldmodulerel.relmodule', 'type' => new \yii\db\Expression($db->quoteValue(1))])
              Severity: Critical
              Found in app/Field.php by phan

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

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

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

                          if ($field[$key] === $fieldMix) {
                              $permission = !($field['visible']);
                              if ($readOnly) {
                                  self::$fieldPermissionCacheRead[$tabId][$fieldMix] = $permission;
                                  self::$columnPermissionCacheRead[$tabId][$field['columnname']] = $permission;
              Severity: Major
              Found in app/Field.php and 1 other location - About 1 hr to fix
              app/Field.php on lines 203..214

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 105.

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

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

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

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

              Refactorings

              Further Reading

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

                          if ($field['columnname'] === $columnName) {
                              $permission = !($field['visible']);
                              if ($readOnly) {
                                  self::$columnPermissionCacheRead[$tabId][$columnName] = $permission;
                                  self::$fieldPermissionCacheRead[$tabId][$field['fieldname']] = $permission;
              Severity: Major
              Found in app/Field.php and 1 other location - About 1 hr to fix
              app/Field.php on lines 155..166

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 105.

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

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

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

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

              Refactorings

              Further Reading

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

                  private static $columnPermissionCacheRead = [];
              Severity: Minor
              Found in app/Field.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

                  private static $fieldPermissionCacheRead = [];
              Severity: Minor
              Found in app/Field.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

                  private static $fieldPermissionCacheWrite = [];
              Severity: Minor
              Found in app/Field.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

                  private static $columnPermissionCacheWrite = [];
              Severity: Minor
              Found in app/Field.php by phpmd

              LongVariable

              Since: 0.2

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

              Example

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

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

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

                          $db = Db::getInstance();
              Severity: Minor
              Found in app/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 for alignment; tabs are not allowed
              Open

                          'validationConditions' => ['name'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedtime',    'column' => 'modifiedtime',    'label' => 'Modified Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      'private' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'created_user_id',    'column' => 'smcreatorid',    'label' => 'Created By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'private',    'column' => 'private',    'label' => 'FL_IS_PRIVATE',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'validationConditions' => ['name'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'createdtime',    'column' => 'createdtime',    'label' => 'Created Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedtime',    'column' => 'modifiedtime',    'label' => 'Modified Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedby',    'column' => 'modifiedby',    'label' => 'Last Modified By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      'shownerid' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 120,    'typeofdata' => 'V~O',    'columntype' => 'int(11)', 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedtime',    'column' => 'modifiedtime',    'label' => 'Modified Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'private',    'column' => 'private',    'label' => 'FL_IS_PRIVATE',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'private',    'column' => 'private',    'label' => 'FL_IS_PRIVATE',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'share_externally',    'column' => 'share_externally',    'label' => 'FL_SHARE_EXTERNALLY',    'defaultvalue' => 0,    'fieldparams' => 1,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedtime',    'column' => 'modifiedtime',    'label' => 'Modified Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedby',    'column' => 'modifiedby',    'label' => 'Last Modified By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 318,    'typeofdata' => 'C~O',    'columntype' => 'tinyint(1)', 'maximumlength' => '-128,127',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int  $tabId    Module ID
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'createdtime',    'column' => 'createdtime',    'label' => 'Created Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'validationConditions' => ['name'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      Log::trace('Entering ' . __METHOD__ . ": $tabId");
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_field.fieldid',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param bool       $readOnly Read/preview only fields
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $key = 'fieldid';
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$columnPermissionCacheRead[$tabId][$columnName] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          self::$columnPermissionCacheWrite[$tabId][$columnName] = false;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 53,    'typeofdata' => 'V~M',    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'shownerid',    'column' => 'shownerid',    'label' => 'Share with users',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'share_externally',    'column' => 'share_externally',    'label' => 'FL_SHARE_EXTERNALLY',    'defaultvalue' => 0,    'fieldparams' => 1,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fields = [];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param bool|string $moduleName
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      'createdtime' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      'created_user_id' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'shownerid',    'column' => 'shownerid',    'label' => 'Share with users',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'share_externally',    'column' => 'share_externally',    'label' => 'FL_SHARE_EXTERNALLY',    'defaultvalue' => 0,    'fieldparams' => 1,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 318,    'typeofdata' => 'C~O',    'columntype' => 'tinyint(1)', 'maximumlength' => '-128,127',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 53,    'typeofdata' => 'V~M',    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      'modifiedtime' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'validationConditions' => ['name'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedby',    'column' => 'modifiedby',    'label' => 'Last Modified By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 120,    'typeofdata' => 'V~O',    'columntype' => 'int(11)', 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'share_externally',    'column' => 'share_externally',    'label' => 'FL_SHARE_EXTERNALLY',    'defaultvalue' => 0,    'fieldparams' => 1,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Function gets the list of fields that the user has permissions to.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_field.columnname',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_field.tabid' => (int) $tabId,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int|string $tabMix   Module ID or module name
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$fieldPermissionCacheRead[$tabId][$fieldMix] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param bool|string $forModule
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'createdtime',    'column' => 'createdtime',    'label' => 'Created Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 56,    'typeofdata' => 'C~O',    'columntype' => 'int(11)', 'maximumlength' => '-128,127', 'presence' => 2, 'generatedtype' => 2,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      'share_externally' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      'modifiedby' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'modifiedby',    'column' => 'modifiedby',    'label' => 'Last Modified By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'shownerid',    'column' => 'shownerid',    'label' => 'Share with users',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'private',    'column' => 'private',    'label' => 'FL_IS_PRIVATE',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->where([
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return self::$fieldPermissionCacheWrite[$tabId][$fieldMix];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          self::$fieldPermissionCacheRead[$tabId][$fieldMix] = false;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$fieldPermissionCacheRead[$tabId][$field['fieldname']] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'validationConditions' => ['column'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'created_user_id',    'column' => 'smcreatorid',    'label' => 'Created By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'validationConditions' => ['uitype', 'fieldparams'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param type $readOnly Read/preview only fields
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getFieldsPermissions($tabId, $readOnly = true)
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_field.presence' => [0, 2],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $fields = static::getFieldsPermissions($tabId, $readOnly);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Get related field for module.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 53,    'typeofdata' => 'V~M',    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 70,    'typeofdata' => 'DT~O',    'displaytype' => 2,    'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'created_user_id',    'column' => 'smcreatorid',    'label' => 'Created By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'validationConditions' => ['name'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 56,    'typeofdata' => 'C~O',    'columntype' => 'int(11)', 'maximumlength' => '-128,127', 'presence' => 2, 'generatedtype' => 2,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 56,    'typeofdata' => 'C~O',    'columntype' => 'int(11)', 'maximumlength' => '-128,127', 'presence' => 2, 'generatedtype' => 2,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'share_externally',    'column' => 'share_externally',    'label' => 'FL_SHARE_EXTERNALLY',    'defaultvalue' => 0,    'fieldparams' => 1,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 318,    'typeofdata' => 'C~O',    'columntype' => 'tinyint(1)', 'maximumlength' => '-128,127',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_field.fieldname',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (!is_numeric($tabMix)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'createdtime',    'column' => 'createdtime',    'label' => 'Created Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      ],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'created_user_id',    'column' => 'smcreatorid',    'label' => 'Created By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'name' => 'shownerid',    'column' => 'shownerid',    'label' => 'Share with users',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          'uitype' => 120,    'typeofdata' => 'V~O',    'columntype' => 'int(11)', 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $fields[$row['fieldname']] = $row;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          Cache::save(__METHOD__ . User::getCurrentUserId(), $tabId, $fields);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      foreach ($fields as &$field) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      Log::trace('Entering ' . __METHOD__ . ": $tabId,$columnName");
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      foreach ($fields as &$field) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if ($field['columnname'] === $columnName) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$columnPermissionCacheWrite[$tabId][$columnName] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$fieldPermissionCacheWrite[$tabId][$field['fieldname']] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      foreach ($fields as $key => $field) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int|string $fieldMix Field ID or field name
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $tabId = $tabMix;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$fieldPermissionCacheWrite[$tabId][$fieldMix] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return self::$columnPermissionCacheRead[$tabId][$columnName];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->from('vtiger_field')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_profile2field', 'vtiger_profile2field.fieldid = vtiger_field.fieldid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $key = 'fieldname';
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param bool       $readOnly   Read/preview only fields
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if ($field['readonly']) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (is_numeric($fieldMix)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fieldMix = (int) $fieldMix;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $permission = !($field['visible']);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          self::$fieldPermissionCacheWrite[$tabId][$fieldMix] = false;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          self::$columnPermissionCacheRead[$tabId][$columnName] = false;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->select([
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $query->andWhere(['vtiger_profile2field.profileid' => $profileList]);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $row['readonly'] = $old['readonly'] > 0 ? $row['readonly'] : $old['readonly'];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (!is_numeric($tabMix)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if ($field[$key] === $fieldMix) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $tabId = $tabMix;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_field.visible' => 0,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              if (isset($fields[$row['fieldname']])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Function checks field permissions by field name or field id.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return self::$fieldPermissionCacheRead[$tabId][$fieldMix];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$columnPermissionCacheRead[$tabId][$field['columnname']] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int|string $tabMix     Module ID or module name
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if ($readOnly && isset(self::$columnPermissionCacheRead[$tabId][$columnName])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $permission = !($field['visible']);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if ($readOnly && isset(self::$fieldPermissionCacheRead[$tabId][$fieldMix])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_profile2field.readonly',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      Log::trace('Entering ' . __METHOD__ . ": $tabId,$fieldMix");
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (!$readOnly && isset(self::$columnPermissionCacheWrite[$tabId][$columnName])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return self::$columnPermissionCacheWrite[$tabId][$columnName];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $row['visible'] = $old['visible'] > 0 ? $row['visible'] : $old['visible'];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              unset($fields[$key]);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (!$readOnly && isset(self::$fieldPermissionCacheWrite[$tabId][$fieldMix])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_profile2field.visible',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  self::$columnPermissionCacheWrite[$tabId][$field['columnname']] = $permission;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param string     $columnName Field ID or field name
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  'vtiger_profile2field.visible' => 0,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $fields = static::getFieldsPermissions($tabId, $readOnly);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $profileList = \App\User::getCurrentUserModel()->getProfiles();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $old = $fields[$row['fieldname']];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $rfields = [];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Function checks field permissions by column name.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Function to gets module field info.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fields = Cache::get('getRelatedFieldForModule', $key);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->from('vtiger_field')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              foreach (ModuleHierarchy::getModulesByUitype($row['uitype']) as $module => $value) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  return $fields[$moduleName][$forModule] ?? [];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->createCommand()->queryAllByGroup();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getFieldInfo($mixed, $module = false)
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Function get module field infos.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      return Cache::get($cacheName, $module);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->from('vtiger_field')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fields = [];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int $relationId
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          Cache::save('FieldInfoById', $mixed, $fieldInfo, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getModuleFieldInfos($module, bool $returnByColumn = false): array
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $cacheName = 'ModuleFieldInfosByName';
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @return array|null
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fieldsInfo = self::getModuleFieldInfos($module);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $fields[$row['name']][$row['relmod']] = $row;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $row['relmod'] = $module;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getRelatedFieldForModule($moduleName = false, $forModule = false)
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->where(['vtiger_tab.presence' => 0]);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $query = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name'])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->createCommand()->query();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $row['type'] = 3;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $rfields[$moduleName] = $forModules[$forModule];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->where(['relation_id' => $relationId, 'vtiger_field.presence' => [0, 2]])->orderBy(['vtiger_relatedlists_fields.relation_id' => SORT_ASC, 'vtiger_relatedlists_fields.sequence' => SORT_ASC])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_ws_referencetype', 'vtiger_ws_fieldtype.fieldtypeid = vtiger_ws_referencetype.fieldtypeid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (is_numeric($mixed)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              return Cache::get('FieldInfoById', $mixed);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->from('vtiger_field')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Function get module field infos by presence.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->leftJoin('s_#__fields_anonymization', 'vtiger_field.fieldid = s_#__fields_anonymization.field_id')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (is_numeric($module)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          Cache::save('ModuleFieldInfosByColumn', $module, $fieldInfoByColumn);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_ws_fieldtype', 'vtiger_field.uitype = vtiger_ws_fieldtype.uitype')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $fields[$row['name']][$row['relmod']] = $row;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (Cache::has('getFieldsFromRelation', $relationId)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fields = Cache::get('getFieldsFromRelation', $relationId);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $fieldInfo = $fieldsInfo[$mixed];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return Cache::get('ModuleFieldInfosByColumn', $module);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_fieldmodulerel', 'vtiger_field.fieldid = vtiger_fieldmodulerel.fieldid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $dataReader = $wsQuery->union($fmrQuery)->createCommand()->query();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->where(['vtiger_tab.presence' => 0, 'vtiger_field.uitype' => [64, 65, 66, 67, 68]]);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Get fields from relation by relation Id.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getModuleFieldInfosByPresence($module, array $presence = ['0', '2']): array
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $moduleFields[$fieldInfo['fieldname']] = $fieldInfo;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $row['conditions'] = Json::decode($row['conditions']);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @return void
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $key = 'all';
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if (isset($fields[$moduleName])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @return string[]
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->from('vtiger_field')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fieldInfoByName = $fieldInfoByColumn = [];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (Cache::has('getRelatedFieldForModule', $key)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          Cache::save('getRelatedFieldForModule', $key, $fields, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              return $fields[$moduleName];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              if (isset($forModules[$forModule])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fields = (new \App\Db\Query())->select(['vtiger_relatedlists_fields.fieldid', 'vtiger_field.fieldname'])->from('vtiger_relatedlists_fields')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_field', 'vtiger_field.fieldid = vtiger_relatedlists_fields.fieldid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if (Cache::has('FieldInfoById', $mixed)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (!Cache::has($cacheName, $module)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->leftJoin('s_#__fields_anonymization', 'vtiger_field.fieldid = s_#__fields_anonymization.field_id')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->where(['tabid' => Module::getModuleId($module)])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if (\in_array($fieldInfo['presence'], $presence)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Get fields type from uitype.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getQuickChangerFields(int $tabId): array
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              'loggedContact' => \App\Language::translate('LBL_LOGGED_CONTACT', 'Settings:LayoutEditor'),
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              'accountLoggedContact' => \App\Language::translate('LBL_ACCOUNT_LOGGED_CONTACT', 'Settings:LayoutEditor'),
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getFieldsFromRelation($relationId)
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (empty($relationId)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->where(['vtiger_field.fieldid' => $mixed])->one();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              Cache::save('FieldInfoById', $fieldInfo['fieldid'], $fieldInfo, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $fieldTypeMapping = (new Db\Query())->from('vtiger_ws_fieldtype')->indexBy('uitype')->all();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $rows = [];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fmrQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_fieldmodulerel.relmodule', 'type' => new \yii\db\Expression($db->quoteValue(1))])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->where(['vtiger_tab.presence' => 0]);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          Cache::save('getFieldsFromRelation', $relationId, $fields, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if ($fieldsInfo && isset($fieldsInfo[$mixed])) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int|string $module
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $module = Module::getModuleName($module);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $fieldInfoByColumn[$row['columnname']] = $row;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $status = 1;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $db = Db::getInstance();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          foreach ($fields as $moduleName => $forModules) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int|string $mixed
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int|string $module
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      Cache::save('getFieldsTypeFromUIType', '', $fieldTypeMapping, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param array      $presence
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              'accountOnContact' => \App\Language::translate('LBL_ACCOUNT_ON_CONTACT', 'Settings:LayoutEditor'),
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      foreach ($fieldsInfo as $fieldInfo) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Check quick changer conditions.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function checkQuickChangerConditions(array $field, \Vtiger_Record_Model $recordModel)
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param \Vtiger_Field_Model $fieldModel
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              ->from('vtiger_field')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $fieldInfo = false;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                              $fieldInfoByName[$row['fieldname']] = $row;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          Cache::save($cacheName, $module, $fieldInfoByName);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (Cache::has('getQuickChangerFields', $tabId)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param \Vtiger_Record_Model $recordModel
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $return = false;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          foreach ($field['values'] as $fieldName => $value) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @return string[]
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $row['values'] = Json::decode($row['values']);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int|string $module
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getFieldsTypeFromUIType()
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $dataReader = (new Db\Query())->from('s_#__record_quick_changer')->where(['tabid' => $tabId])->createCommand()->query();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param array                $field
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                                  $return = true;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * @param int $tabId
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (!isset($status)) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $moduleFields = [];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Get quick changer fields.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                              if (isset($fields[$fieldName]) && $fields[$fieldName]->isEditable()) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      $fieldsInfo = self::getModuleFieldInfos($module);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if (Cache::has('getFieldsTypeFromUIType', '')) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return Cache::get('getFieldsTypeFromUIType', '');
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          if ($recordModel->get($fieldName) !== $value) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $rows[$row['id']] = $row;
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      foreach ($field['conditions'] as $fieldName => $value) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                  public static function getCustomListForDefaultValue(\Vtiger_Field_Model $fieldModel): array
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          return Cache::get('getQuickChangerFields', $tabId);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                      Cache::save('getQuickChangerFields', $tabId, $rows, Cache::LONG);
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                          $fields = $recordModel->getModule()->getFields();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

                   * Get a list of custom default values for a given field type in the WebservicePremium API.
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              Spaces must be used for alignment; tabs are not allowed
              Open

                      if ($fieldModel->isReferenceField()) {
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Spaces must be used for alignment; tabs are not allowed
              Open

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

              The 'getFieldPermission()' method which returns a boolean should be named 'is...()' or 'has...()'
              Open

                  public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
                  {
                      $tabId = $tabMix;
                      if (!is_numeric($tabMix)) {
                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/Field.php by phpmd

              BooleanGetMethodName

              Since: 0.2

              Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

              Example

              class Foo {
                  /**
                   * @return boolean
                   */
                  public function getFoo() {} // bad
                  /**
                   * @return bool
                   */
                  public function isFoo(); // ok
                  /**
                   * @return boolean
                   */
                  public function getFoo($bar); // ok, unless checkParameterizedMethods=true
              }

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

              The 'getColumnPermission()' method which returns a boolean should be named 'is...()' or 'has...()'
              Open

                  public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
                  {
                      $tabId = $tabMix;
                      if (!is_numeric($tabMix)) {
                          $tabId = Module::getModuleId($tabMix);
              Severity: Minor
              Found in app/Field.php by phpmd

              BooleanGetMethodName

              Since: 0.2

              Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

              Example

              class Foo {
                  /**
                   * @return boolean
                   */
                  public function getFoo() {} // bad
                  /**
                   * @return bool
                   */
                  public function isFoo(); // ok
                  /**
                   * @return boolean
                   */
                  public function getFoo($bar); // ok, unless checkParameterizedMethods=true
              }

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

              Line exceeds 120 characters; contains 126 characters
              Open

                          'name' => 'modifiedby',    'column' => 'modifiedby',    'label' => 'Last Modified By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

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

                  /** @var string[] Help info views. */
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

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

                  /** @var array System fields */
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 130 characters
              Open

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

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

                  const HELP_INFO_VIEWS = ['LBL_EDIT_VIEW' => 'Edit', 'LBL_DETAIL_VIEW' => 'Detail', 'LBL_QUICK_CREATE_VIEW' => 'QuickCreateAjax'];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

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

                          'name' => 'assigned_user_id',    'column' => 'smownerid',    'label' => 'Assigned To',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 130 characters
              Open

                          'name' => 'created_user_id',    'column' => 'smcreatorid',    'label' => 'Created By',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 138 characters
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

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

                  const SYSTEM_FIELDS = [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 148 characters
              Open

                          'uitype' => 56,    'typeofdata' => 'C~O',    'columntype' => 'int(11)', 'maximumlength' => '-128,127', 'presence' => 2, 'generatedtype' => 2,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 133 characters
              Open

                  const HELP_INFO_VIEWS = ['LBL_EDIT_VIEW' => 'Edit', 'LBL_DETAIL_VIEW' => 'Detail', 'LBL_QUICK_CREATE_VIEW' => 'QuickCreateAjax'];
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 155 characters
              Open

                          'name' => 'share_externally',    'column' => 'share_externally',    'label' => 'FL_SHARE_EXTERNALLY',    'defaultvalue' => 0,    'fieldparams' => 1,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

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

                      'assigned_user_id' => [
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 126 characters
              Open

                          'name' => 'createdtime',    'column' => 'createdtime',    'label' => 'Created Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 138 characters
              Open

                          'uitype' => 52,    'typeofdata' => 'V~O',    'displaytype' => 2,    'quickcreate' => 3, 'masseditable' => 0, 'maximumlength' => 65535,
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

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

                          'validationConditions' => ['name'],
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 126 characters
              Open

                          'name' => 'modifiedtime',    'column' => 'modifiedtime',    'label' => 'Modified Time',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 126 characters
              Open

                          'name' => 'shownerid',    'column' => 'shownerid',    'label' => 'Share with users',    'table' => 'vtiger_crmentity',
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 241 characters
              Open

                          $query = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name'])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 153 characters
              Open

                          $fields = (new \App\Db\Query())->select(['vtiger_relatedlists_fields.fieldid', 'vtiger_field.fieldname'])->from('vtiger_relatedlists_fields')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 206 characters
              Open

                              ->where(['relation_id' => $relationId, 'vtiger_field.presence' => [0, 2]])->orderBy(['vtiger_relatedlists_fields.relation_id' => SORT_ASC, 'vtiger_relatedlists_fields.sequence' => SORT_ASC])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 345 characters
              Open

                          $fmrQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_fieldmodulerel.relmodule', 'type' => new \yii\db\Expression($db->quoteValue(1))])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 341 characters
              Open

                          $wsQuery = (new Db\Query())->select(['vtiger_field.fieldid', 'vtiger_field.uitype', 'vtiger_field.tabid', 'vtiger_field.columnname', 'vtiger_field.fieldname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_tab.name', 'relmod' => 'vtiger_ws_referencetype.type', 'type' => new \yii\db\Expression($db->quoteValue(2))])
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 127 characters
              Open

                              ->innerJoin('vtiger_ws_referencetype', 'vtiger_ws_fieldtype.fieldtypeid = vtiger_ws_referencetype.fieldtypeid')
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 128 characters
              Open

                      $dataReader = (new Db\Query())->from('s_#__record_quick_changer')->where(['tabid' => $tabId])->createCommand()->query();
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              Line exceeds 120 characters; contains 122 characters
              Open

                              'accountLoggedContact' => \App\Language::translate('LBL_ACCOUNT_LOGGED_CONTACT', 'Settings:LayoutEditor'),
              Severity: Minor
              Found in app/Field.php by phpcodesniffer

              There are no issues that match your filters.

              Category
              Status