YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/actions/Fields.php

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function getOwners has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOwners(App\Request $request): void
    {
        if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {
            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
        }
Severity: Minor
Found in modules/Vtiger/actions/Fields.php - About 3 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

class Vtiger_Fields_Action extends \App\Controller\Action
{
    use \App\Controller\ExposeMethod;

    /**
Severity: Minor
Found in modules/Vtiger/actions/Fields.php by phpmd

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

    public function getReference(App\Request $request): void
    {
        if ($request->has('fieldName')) {
            $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
            if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {
Severity: Minor
Found in modules/Vtiger/actions/Fields.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 getOwners has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getOwners(App\Request $request): void
    {
        if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {
            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
        }
Severity: Minor
Found in modules/Vtiger/actions/Fields.php - About 1 hr to fix

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

        public function getReference(App\Request $request): void
        {
            if ($request->has('fieldName')) {
                $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
                if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {
    Severity: Minor
    Found in modules/Vtiger/actions/Fields.php - About 1 hr to fix

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

          public function checkPermission(App\Request $request)
          {
              $mode = $request->getMode();
              if ('verifyPhoneNumber' !== $mode) {
                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 verifyPhoneNumber has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function verifyPhoneNumber(App\Request $request): void
          {
              if ('phone' !== $this->fieldModel->getFieldDataType()) {
                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD');
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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

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

          public function getUserRole(App\Request $request): void
          {
              if (!App\Config::performance('SEARCH_ROLES_BY_AJAX')) {
                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      The method getOwners() has an NPath complexity of 272. The configured NPath complexity threshold is 200.
      Open

          public function getOwners(App\Request $request): void
          {
              if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {
                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getReference() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
      Open

          public function getReference(App\Request $request): void
          {
              if ($request->has('fieldName')) {
                  $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
                  if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 checkPermission() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
      Open

          public function checkPermission(App\Request $request)
          {
              $mode = $request->getMode();
              if ('verifyPhoneNumber' !== $mode) {
                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getOwners() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
      Open

          public function getOwners(App\Request $request): void
          {
              if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {
                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

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

          public function getReference(App\Request $request): void
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 25 to the 15 allowed.
      Open

          public function getOwners(App\Request $request): void
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by sonar-php

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

      See

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

                  $response->setResult(['items' => $data]);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      UndefinedVariable

      Since: 2.8.0

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

      Example

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

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

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

                      $data[] = ['id' => $key, 'name' => $value];
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      UndefinedVariable

      Since: 2.8.0

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

      Example

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

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

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

      class Vtiger_Fields_Action extends \App\Controller\Action
      {
          use \App\Controller\ExposeMethod;
      
          /**
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      CouplingBetweenObjects

      Since: 1.1.0

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

      Example

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

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

      Missing class import via use statement (line '80', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD');
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '137', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '300', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '37', column '15').
      Open

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '298', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('ERR_ILLEGAL_VALUE', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '207', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '131', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '253', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '280', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '90', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Missing class import via use statement (line '325', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '180', column '16').
      Open

              $rows = (new \App\RecordSearch($searchValue, $searchInModule, $limit))->setMode(\App\RecordSearch::LABEL_MODE)->search();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '205', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD');
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '175', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '234', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '276', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '46', column '15').
      Open

                      throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '160', column '15').
      Open

                      throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '177', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '260', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      MissingImport

      Since: 2.7.0

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

      Example

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

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

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

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '40', column '15').
      Open

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '134', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD');
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 '\Vtiger_Record_Model' in method 'validateForField'.
      Open

              $recordModel = \Vtiger_Record_Model::getCleanInstance($fieldModel->getModuleName());
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Relation' in method 'getReference'.
      Open

              } elseif ($request->has('relationId') && ($relation = \App\Relation::getById($request->getInteger('relationId'))) && $relation['related_modulename'] === $request->getModule()) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 'verifyPhoneNumber'.
      Open

                  $data['message'] = \App\Language::translate('LBL_NO_PHONE_COUNTRY');
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 'changeFavoriteOwner'.
      Open

              if (!App\Config::module('Users', 'FAVORITE_OWNERS') || (\App\User::getCurrentUserRealId() !== \App\User::getCurrentUserId())) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 'changeFavoriteOwner'.
      Open

              $message = \App\Language::translate($this->fieldModel->getFieldLabel(), $moduleName) . ': ' . \App\Language::translate($message, $moduleName);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class 'App\Fields\Owner' in method 'getOwners'.
      Open

                  $owner = App\Fields\Owner::getInstance($moduleName);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 validateFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $validateError = $fileInstance->validateError;
                  }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Language' in method 'verifyPhoneNumber'.
      Open

                  $data['message'] = \App\Language::translate('LBL_INVALID_PHONE_NUMBER');
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Config' in method 'changeFavoriteOwner'.
      Open

              if (!App\Config::module('Users', 'FAVORITE_OWNERS') || (\App\User::getCurrentUserRealId() !== \App\User::getCurrentUserId())) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getOwners uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $owner = App\Fields\Owner::getInstance($moduleName);
                  $owner->find($searchValue);
      
                  $data = [];
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Language' in method 'getReference'.
      Open

                  $data[] = ['name' => App\Language::translateSingleMod($moduleName, $moduleName), 'type' => 'optgroup'];
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getOwners uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $result = ['users', 'groups'];
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getUserRole uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $rows = $this->fieldModel->getUITypeModel()->getSearchValues($searchValue);
                  foreach ($rows as $key => $value) {
                      $data[] = ['id' => $key, 'name' => $value];
                  }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getReference uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                      } else {
                          $searchInModule = $relation['related_modulename'];
                      }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 'Users_Privileges_Model' in method 'checkPermission'.
      Open

                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 'getOwners'.
      Open

                          $data[] = ['name' => \App\Language::translate('LBL_GROUPS'), 'type' => 'optgroup'];
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\File' in method 'validateFile'.
      Open

                  $fileInstance = \App\Fields\File::loadFromBase($request->getByType('base64', 'base64'), ['validateAllowedFormat' => 'image']);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Config' in method 'getOwners'.
      Open

              if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getReference uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 'changeFavoriteOwner'.
      Open

              if (!App\Config::module('Users', 'FAVORITE_OWNERS') || (\App\User::getCurrentUserRealId() !== \App\User::getCurrentUserId())) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class '\App\Fields\Owner' in method 'changeFavoriteOwner'.
      Open

              $ownerField = \App\Fields\Owner::getInstance($moduleName);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 'getOwners'.
      Open

                          $data[] = ['name' => \App\Language::translate('LBL_USERS'), 'type' => 'optgroup'];
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Config' in method 'getUserRole'.
      Open

              if (!App\Config::performance('SEARCH_ROLES_BY_AJAX')) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 getReference uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $typeRelationModel = \Vtiger_Relation_Model::getInstanceById($relation['relation_id'])->getTypeRelationModel();
                      if (method_exists($typeRelationModel, 'getConfigAdvancedConditionsByColumns')) {
                          $searchInModule = $typeRelationModel->getConfigAdvancedConditionsByColumns()['relatedModules'] ?? $relation['related_modulename'];
                      } else {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Purifier' in method 'getReference'.
      Open

                      $data[] = ['id' => $row['crmid'], 'name' => \App\Purifier::encodeHtml($row['label'])];
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class 'App\Fields\Phone' in method 'verifyPhoneNumber'.
      Open

                      $data = App\Fields\Phone::verifyNumber($request->getByType('phoneNumber', 'Text'), $request->getByType('phoneCountry', 1));
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Privilege' in method 'checkPermission'.
      Open

                  if ('getReference' !== $mode && !\App\Privilege::isPermitted($request->getModule(), 'EditView')) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Config' in method 'getReference'.
      Open

              $limit = \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_LIMIT');
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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\Map\Address' in method 'findAddress'.
      Open

              $instance = \App\Map\Address::getInstance($request->getByType('type'));
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

          public function getReference(App\Request $request): void
          {
              if ($request->has('fieldName')) {
                  $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
                  if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      IfStatementAssignment

      Since: 2.7.0

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

      Example

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

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

      Avoid using static access to class '\App\Language' in method 'changeFavoriteOwner'.
      Open

              $message = \App\Language::translate($this->fieldModel->getFieldLabel(), $moduleName) . ': ' . \App\Language::translate($message, $moduleName);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.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 "getReference" 3 times.
      Open

                  if ('getReference' !== $mode && !\App\Privilege::isPermitted($request->getModule(), 'EditView')) {
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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.

      Rename "$fieldModel" which has the same name as the field declared at line 22.
      Open

              $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
      Severity: Major
      Found in modules/Vtiger/actions/Fields.php by sonar-php

      Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

      Noncompliant Code Example

      class Foo {
        public $myField;
      
        public function doSomething() {
          $myField = 0;
          ...
        }
      }
      

      See

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

              if ($request->has('base64')) {
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "owner" 4 times.
      Open

              if ('owner' !== $this->fieldModel->getFieldDataType() && 'sharedOwner' !== $this->fieldModel->getFieldDataType()
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "optgroup" 3 times.
      Open

                          $data[] = ['name' => \App\Language::translate('LBL_USERS'), 'type' => 'optgroup'];
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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.

      Rename "$fieldModel" which has the same name as the field declared at line 22.
      Open

                  $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
      Severity: Major
      Found in modules/Vtiger/actions/Fields.php by sonar-php

      Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

      Noncompliant Code Example

      class Foo {
        public $myField;
      
        public function doSomething() {
          $myField = 0;
          ...
        }
      }
      

      See

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

              } elseif ($request->has('relationId') && ($relation = \App\Relation::getById($request->getInteger('relationId'))) && $relation['related_modulename'] === $request->getModule()) {
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "result" 3 times.
      Open

              if ($request->has('result')) {
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "value" 6 times.
      Open

              $searchValue = $request->getByType('value', 'Text');
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "message" 5 times.
      Open

                  $data['message'] = \App\Language::translate('LBL_NO_PHONE_COUNTRY');
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "LBL_PERMISSION_DENIED" 5 times.
      Open

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "ERR_NO_PERMISSIONS_TO_FIELD" 7 times.
      Open

                      throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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" 4 times.
      Open

                  $this->fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "isValidNumber" 3 times.
      Open

              $data = ['isValidNumber' => false];
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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 "items" 5 times.
      Open

                  $response->setResult(['items' => []]);
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.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.

      Argument 1 (mixed) is string but \Users_Privileges_Model::hasModulePermission() takes int defined at /code/modules/Users/models/Privileges.php:101
      Open

                  if (!$userPrivilegesModel->hasModulePermission($request->getModule())) {
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phan

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

              if (!App\Config::module('Users', 'FAVORITE_OWNERS') || (\App\User::getCurrentUserRealId() !== \App\User::getCurrentUserId())) {
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by phan

      Call to deprecated function \Vtiger_Field_Model::getFieldLabel() defined at /code/modules/Vtiger/models/Field.php:215
      Open

              $message = \App\Language::translate($this->fieldModel->getFieldLabel(), $moduleName) . ': ' . \App\Language::translate($message, $moduleName);
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phan

      Call to undeclared method \Vtiger_Base_UIType::getSearchValues
      Open

                  $rows = $this->fieldModel->getUITypeModel()->getSearchValues($searchValue);
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by phan

      @throws type of changeFavoriteOwner has undeclared type \yii\db\Exception (Did you mean class \Exception)
      Open

          public function changeFavoriteOwner(App\Request $request): void
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phan

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

              if (!App\Config::module('Users', 'FAVORITE_OWNERS') || (\App\User::getCurrentUserRealId() !== \App\User::getCurrentUserId())) {
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by phan

      Call to undeclared method \App\Relation\RelationAbstraction::getConfigAdvancedConditionsByColumns
      Open

                          $searchInModule = $typeRelationModel->getConfigAdvancedConditionsByColumns()['relatedModules'] ?? $relation['related_modulename'];
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by phan

      Variable $data was undeclared, but array fields are being added to it.
      Open

                      $data[] = ['id' => $key, 'name' => $value];
      Severity: Info
      Found in modules/Vtiger/actions/Fields.php by phan

      Call to method getInstance from undeclared class \App\Fields\Owner
      Open

              $ownerField = \App\Fields\Owner::getInstance($moduleName);
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by phan

      Call to method getInstance from undeclared class \App\Fields\Owner
      Open

                  $owner = App\Fields\Owner::getInstance($moduleName);
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by phan

      Call to method find from undeclared class \App\Map\Address\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
      Open

                  $response->setResult($instance->find($request->getByType('value', 'Text')));
      Severity: Critical
      Found in modules/Vtiger/actions/Fields.php by phan

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

      class Vtiger_Fields_Action extends \App\Controller\Action

      The class Vtiger_Fields_Action is not named in CamelCase.
      Open

      class Vtiger_Fields_Action extends \App\Controller\Action
      {
          use \App\Controller\ExposeMethod;
      
          /**
      Severity: Minor
      Found in modules/Vtiger/actions/Fields.php by phpmd

      CamelCaseClassName

      Since: 0.2

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

      Example

      class class_name {
      }

      Source

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

          /**

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

                  if (!$this->fieldModel || !$this->fieldModel->isViewable()) {

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

              $this->exposeMethod('getUserRole');

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

           * Get owners for ajax owners list.

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

              }

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

              $response = new Vtiger_Response();

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

                      }

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

                          foreach ($grup as $key => $value) {

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

          public function getUserRole(App\Request $request): void

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

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD');

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

           * @var Vtiger_Field_Model

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

                      throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);

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

          public function getOwners(App\Request $request): void

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

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD');

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

                          $data[] = ['name' => \App\Language::translate('LBL_USERS'), 'type' => 'optgroup'];

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

              }

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

              $searchValue = $request->getByType('value', 'Text');

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

          use \App\Controller\ExposeMethod;

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

           * Field model instance.

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

                  if ('getReference' !== $mode && !\App\Privilege::isPermitted($request->getModule(), 'EditView')) {

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

           * @throws \App\Exceptions\NoPermitted

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

              } else {

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

                      $users = $owner->getAccessibleUsers('', 'owner');

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

           *

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

          }

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

              parent::__construct();

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

              $this->exposeMethod('getReference');

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

                      if (!empty($users)) {

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

                  }

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

           *

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

                  }

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

          }

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

          public function getReference(App\Request $request): void

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

           */

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

           * @param \App\Request $request

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

          {

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

              $this->exposeMethod('getOwners');

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

           *

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

              if (empty($searchValue)) {

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

              $response->emit();

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

           * @param \App\Request $request

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

              } else {

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

                  }

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

              $this->exposeMethod('validateFile');

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

                      if (!empty($grup)) {

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

                          }

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

          {

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

              if (!App\Config::performance('SEARCH_ROLES_BY_AJAX')) {

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

              $response->emit();

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

                  if (!$userPrivilegesModel->hasModulePermission($request->getModule())) {

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

              if ('findAddress' !== $mode && 'getReference' !== $mode && 'validateByMode' !== $mode) {

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

          public function __construct()

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

              $this->exposeMethod('validateByMode');

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

           * @param \App\Request $request

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

           */

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

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

           * @throws \App\Exceptions\NoPermitted

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

           */

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

              if ('userRole' !== $this->fieldModel->getFieldDataType()) {

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

                      $data[] = ['id' => $key, 'name' => $value];

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

          /**

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

           * @throws \App\Exceptions\NoPermitted

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

          {

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

              if ($request->has('fieldName')) {

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

                      $typeRelationModel = \Vtiger_Relation_Model::getInstanceById($relation['relation_id'])->getTypeRelationModel();

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

                      if (method_exists($typeRelationModel, 'getConfigAdvancedConditionsByColumns')) {

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

              } else {

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

              $response->setResult(['items' => $data]);

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

          {

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

              }

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

          /**

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

           * @throws \App\Exceptions\IllegalValue

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

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

              $response = new Vtiger_Response();

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

              $response->setResult(['result' => $result, 'message' => $message]);

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

           * @throws \App\Exceptions\NoPermitted

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

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

                  }

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

          /**

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

              }

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

                              $data[] = ['id' => $key, 'name' => $value];

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

                          }

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

                  }

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

                  if (\in_array('groups', $result)) {

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

                  $response->setResult(['items' => $data]);

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

          }

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

           * Search user roles.

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

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

                      }

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

                  foreach ($rows as $row) {

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

                  $data[] = ['name' => App\Language::translateSingleMod($moduleName, $moduleName), 'type' => 'optgroup'];

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

          }

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

           * @throws \App\Exceptions\NoPermitted

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

              $result = $ownerField->changeFavorites($this->fieldModel->getFieldDataType(), $request->getInteger('owner'));

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

          {

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

              if ('owner' !== $this->fieldModel->getFieldDataType() && 'sharedOwner' !== $this->fieldModel->getFieldDataType()

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

                  $result = ['users', 'groups'];

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

                  $response->setResult(['items' => $data]);

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

           *

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

              $mode = $request->getMode();

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

                  $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

                  }

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

          }

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

              }

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

              if ($request->has('result')) {

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

                  $owner = App\Fields\Owner::getInstance($moduleName);

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

                  $data = [];

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

                  if (\in_array('users', $result)) {

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

              if (empty($searchValue)) {

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

                  foreach ($rows as $key => $value) {

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

                          $searchInModule = $relation['related_modulename'];

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

              $response = new Vtiger_Response();

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

                      $data = App\Fields\Phone::verifyNumber($request->getByType('phoneNumber', 'Text'), $request->getByType('phoneCountry', 1));

      Line exceeds 120 characters; contains 139 characters
      Open

                      $data = App\Fields\Phone::verifyNumber($request->getByType('phoneNumber', 'Text'), $request->getByType('phoneCountry', 1));

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

                      $data = ['isValidNumber' => false];

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

          }

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

              }

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

              }

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

          public function validateForField(App\Request $request): void

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

              }

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

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

              $this->exposeMethod('validateForField');

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

          /**

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

                  $owner->find($searchValue);

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

              $this->exposeMethod('changeFavoriteOwner');

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

              }

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

              if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {

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

              }

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

           *

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

              $data = $modules = [];

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

                  $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));

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

              $response->emit();

      Line exceeds 120 characters; contains 160 characters
      Open

              $searchValue = \App\RecordSearch::getSearchField()->getUITypeModel()->getDbConditionBuilderValue($request->getByType('value', \App\Purifier::TEXT), '');

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

           *

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

                  foreach ($rows as $row) {

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

           */

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

          public function verifyPhoneNumber(App\Request $request): void

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

           * Verify phone number.

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

              if ('phone' !== $this->fieldModel->getFieldDataType()) {

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

           */

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

              $response->emit();

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

          public function changeFavoriteOwner(App\Request $request): void

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

              $response->emit();

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

           */

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

              $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));

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

              if ($instance) {

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

              if (!$fieldModel || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {

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

           * Function to check permission.

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

           *

      Line exceeds 120 characters; contains 141 characters
      Open

                  $this->fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));

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

              $this->exposeMethod('findAddress');

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

                  && 'userCreator' !== $this->fieldModel->getFieldDataType()) {

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

              } else {

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

                              $data[] = ['id' => $key, 'name' => $value];

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

              }

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

              $response = new Vtiger_Response();

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

                  $rows = $this->fieldModel->getUITypeModel()->getSearchValues($searchValue);

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

                  }

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

                  try {

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

                  }

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

           * @param \App\Request $request

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

           * @throws \yii\db\Exception

      Line exceeds 120 characters; contains 135 characters
      Open

              if (!App\Config::module('Users', 'FAVORITE_OWNERS') || (\App\User::getCurrentUserRealId() !== \App\User::getCurrentUserId())) {

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

                  'display' => $recordModel->getDisplayValue($fieldModel->getName()),

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

           * @throws \App\Exceptions\NoPermitted

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

           */

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

                      $searchInModule = $relation['related_modulename'];

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

                  } else {

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

              }

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

           *

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

          /**

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

              ]);

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

                  throw new \App\Exceptions\NoPermitted('ERR_ILLEGAL_VALUE', 406);

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

           *

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

           */

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

          public function checkPermission(App\Request $request)

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

              }

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

                  $this->fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));

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

              }

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

          {

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

           *

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

              $searchValue = $request->getByType('value', 'Text');

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

                  $result = $request->getArray('result', 'Standard');

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

           * @param \App\Request $request

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

           */

      Line exceeds 120 characters; contains 129 characters
      Open

              $rows = (new \App\RecordSearch($searchValue, $searchInModule, $limit))->setMode(\App\RecordSearch::LABEL_MODE)->search();

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

              $response->setResult($data);

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

          public function findAddress(App\Request $request): void

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

          }

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

           * Validate the field name and value.

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

              $recordModel = \Vtiger_Record_Model::getCleanInstance($fieldModel->getModuleName());

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

          }

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

          protected $fieldModel;

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

              if ('verifyPhoneNumber' !== $mode) {

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

              $moduleName = $request->getModule();

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

                          $data[] = ['name' => \App\Language::translate('LBL_GROUPS'), 'type' => 'optgroup'];

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

                      }

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

                  $response->setResult(['items' => []]);

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

                  if (\in_array($relation['related_modulename'], ['getDependentsList', 'getManyToMany', 'getRelatedList'])) {

      Line exceeds 120 characters; contains 127 characters
      Open

                      $typeRelationModel = \Vtiger_Relation_Model::getInstanceById($relation['relation_id'])->getTypeRelationModel();

      Line exceeds 120 characters; contains 150 characters
      Open

                          $searchInModule = $typeRelationModel->getConfigAdvancedConditionsByColumns()['relatedModules'] ?? $relation['related_modulename'];

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

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);

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

              $limit = \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_LIMIT');

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

                      $modules[$row['setype']][] = $row;

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

              $data = ['isValidNumber' => false];

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

                  $data['message'] = \App\Language::translate('LBL_INVALID_PHONE_NUMBER');

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

           * @param \App\Request $request

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

              $response = new Vtiger_Response();

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

           * @return void

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

          {

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

                  } else {

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

              $this->exposeMethod('verifyPhoneNumber');

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

                  $response->setResult(['items' => []]);

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

                          foreach ($users as $key => $value) {

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

                      $grup = $owner->getAccessibleGroups('', 'owner', true);

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

          /**

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

              }

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

                  }

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

              } elseif ($request->has('relationId') && ($relation = \App\Relation::getById($request->getInteger('relationId'))) && $relation['related_modulename'] === $request->getModule()) {

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

                  }

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

                      $data[] = ['id' => $row['crmid'], 'name' => \App\Purifier::encodeHtml($row['label'])];

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

              }

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

              $response = new Vtiger_Response();

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

           *

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

              $response->setResult([

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

           */

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

              }

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

          }

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

                      throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);

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

              $searchValue = \App\RecordSearch::getSearchField()->getUITypeModel()->getDbConditionBuilderValue($request->getByType('value', \App\Purifier::TEXT), '');

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

              foreach ($modules as $moduleName => $rows) {

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

              if ($request->isEmpty('phoneCountry', true)) {

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

              }

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

           * @param \App\Request $request

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

          {

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

           * @throws \App\Exceptions\NoPermitted

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

              $message = $result ? 'LBL_MODIFICATION_SUCCESSFUL_AND_RELOAD' : 'LBL_MODIFICATION_FAILURE';

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

              $message = \App\Language::translate($this->fieldModel->getFieldLabel(), $moduleName) . ': ' . \App\Language::translate($message, $moduleName);

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

          {

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

          /**

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

          public function validateByMode(App\Request $request): void

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

              $response->emit();

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

                  if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {

      Line exceeds 120 characters; contains 185 characters
      Open

              } elseif ($request->has('relationId') && ($relation = \App\Relation::getById($request->getInteger('relationId'))) && $relation['related_modulename'] === $request->getModule()) {

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

                          $searchInModule = $typeRelationModel->getConfigAdvancedConditionsByColumns()['relatedModules'] ?? $relation['related_modulename'];

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

          /**

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

           * @param \App\Request $request

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

              }

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

           * Find address.

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

              $moduleName = $request->getModule();

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

          /**

      Line exceeds 120 characters; contains 131 characters
      Open

              $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));

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

          {

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

                  'raw' => $request->getByType('value', $request->getByType('purifyMode')),

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

                  'validate' => $validate,

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

              ]);

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

                  $data['message'] = \App\Language::translate('LBL_NO_PHONE_COUNTRY');

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

                  } catch (\App\Exceptions\FieldException $e) {

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

           *

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

              $instance = \App\Map\Address::getInstance($request->getByType('type'));

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

              $response = new Vtiger_Response();

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

                  $response->setResult($instance->find($request->getByType('value', 'Text')));

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

              $response->emit();

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

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD', 406);

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

              $fieldModel->getUITypeModel()->setValueFromRequest($request, $recordModel, 'fieldValue');

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

              $response = new Vtiger_Response();

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

              $response->setResult([

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

           * @param \App\Request $request

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

           *

      Line exceeds 120 characters; contains 135 characters
      Open

                  $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));

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

                  $searchInModule = $fieldModel->getReferenceList();

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

                  }

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

          }

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

          {

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

              if (!App\Config::module('Users', 'FAVORITE_OWNERS') || (\App\User::getCurrentUserRealId() !== \App\User::getCurrentUserId())) {

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

           *

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

                  'raw' => $recordModel->get($fieldModel->getName()),

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

           * @throws \App\Exceptions\NoPermitted

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

           */

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

          public function validateFile(App\Request $request): void

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

                      $validate = true;

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

           * Validate the value based on the type of purify.

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

              if ($request->isEmpty('purifyMode') || !$request->has('value')) {

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

              if ($request->has('base64')) {

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

                  $fileInstance = \App\Fields\File::loadFromBase($request->getByType('base64', 'base64'), ['validateAllowedFormat' => 'image']);

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

              $rows = (new \App\RecordSearch($searchValue, $searchInModule, $limit))->setMode(\App\RecordSearch::LABEL_MODE)->search();

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

                  throw new \App\Exceptions\NoPermitted('ERR_NO_PERMISSIONS_TO_FIELD');

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

           * Change favorite owner state.

      Line exceeds 120 characters; contains 150 characters
      Open

              $message = \App\Language::translate($this->fieldModel->getFieldLabel(), $moduleName) . ': ' . \App\Language::translate($message, $moduleName);

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

           *

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

          /**

      Line exceeds 120 characters; contains 138 characters
      Open

                  $fileInstance = \App\Fields\File::loadFromBase($request->getByType('base64', 'base64'), ['validateAllowedFormat' => 'image']);

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

                  if ($fileInstance && $fileInstance->validate()) {

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

              $response->setResult([

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

              $response = new Vtiger_Response();

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

                      } else {

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

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

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

              if (!$data['isValidNumber'] && empty($data['message'])) {

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

           *

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

           *

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

              $ownerField = \App\Fields\Owner::getInstance($moduleName);

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

              $response->emit();

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

          }

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

           *

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

              $validate = false;

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

              }

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

           * Validate file.

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

                  }

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

              ]);

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

           * @param App\Request $request

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

                      $validateError = $fileInstance->validateError;

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

                  'validateError' => $validateError ?? null,

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

              $response->emit();

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

           *

      Class name "Vtiger_Fields_Action" is not in camel caps format
      Open

      class Vtiger_Fields_Action extends \App\Controller\Action

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  }

      Line indented incorrectly; expected 8 spaces, found 12
      Open

                  foreach ($rows as $row) {

      There are no issues that match your filters.

      Category
      Status