YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function setRelatedFieldsInHierarchy has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function setRelatedFieldsInHierarchy(Vtiger_Record_Model $recordModel, $fieldName)
    {
        $fieldValue = $recordModel->get($fieldName);
        $relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);
        if ($relatedModules && !empty($fieldValue) && $recordModel->getPreviousValue($fieldName) !== $fieldValue) {
Severity: Minor
Found in modules/Vtiger/actions/SaveAjax.php - About 4 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 process has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        if ($mode = $request->getMode()) {
            $this->invokeExposedMethod($mode, $request);
            return;
Severity: Minor
Found in modules/Vtiger/actions/SaveAjax.php - About 1 hr to fix

    Method setRelatedFieldsInHierarchy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function setRelatedFieldsInHierarchy(Vtiger_Record_Model $recordModel, $fieldName)
        {
            $fieldValue = $recordModel->get($fieldName);
            $relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);
            if ($relatedModules && !empty($fieldValue) && $recordModel->getPreviousValue($fieldName) !== $fieldValue) {
    Severity: Minor
    Found in modules/Vtiger/actions/SaveAjax.php - About 1 hr to fix

      Function getRecordModelFromRequest has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getRecordModelFromRequest(App\Request $request)
          {
              if ('QuickEdit' !== $request->getByType('fromView') && !$request->isEmpty('record')) {
                  $recordModel = $this->record ?: Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
                  $fieldModel = $recordModel->getModule()->getFieldByName($request->getByType('field', 2));
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.php - About 55 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 process has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function process(App\Request $request)
          {
              if ($mode = $request->getMode()) {
                  $this->invokeExposedMethod($mode, $request);
                  return;
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.php - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          public function setRelatedFieldsInHierarchy(Vtiger_Record_Model $recordModel, $fieldName)
          {
              $fieldValue = $recordModel->get($fieldName);
              $relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);
              if ($relatedModules && !empty($fieldValue) && $recordModel->getPreviousValue($fieldName) !== $fieldValue) {
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.php by phpmd

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

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

          public function setRelatedFieldsInHierarchy(Vtiger_Record_Model $recordModel, $fieldName)
      Severity: Critical
      Found in modules/Vtiger/actions/SaveAjax.php by sonar-php

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

      See

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

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

      MissingImport

      Since: 2.7.0

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

      Example

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

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

      Avoid using static access to class '\App\ModuleHierarchy' in method 'setRelatedFieldsInHierarchy'.
      Open

              $relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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\Record' in method 'setRelatedFieldsInHierarchy'.
      Open

                  $sourceModule = \App\Record::getType($fieldValue);
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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 setRelatedFieldsInHierarchy uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                                  } else {
                                      $recordModel->set($toModel->getName(), $relFieldValue);
                                  }
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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 'process'.
      Open

                      'value' => \App\Purifier::encodeHtml($this->record->getRawValue($fieldName)),
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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 '21', column '7').
      Open

          public function process(App\Request $request)
          {
              if ($mode = $request->getMode()) {
                  $this->invokeExposedMethod($mode, $request);
                  return;
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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 assigning values to variables in if clauses and the like (line '33', column '19').
      Open

          public function process(App\Request $request)
          {
              if ($mode = $request->getMode()) {
                  $this->invokeExposedMethod($mode, $request);
                  return;
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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 '\Vtiger_Record_Model' in method 'setRelatedFieldsInHierarchy'.
      Open

                          $relRecordModel = \Vtiger_Record_Model::getInstanceById($fieldValue, $sourceModule);
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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 getRecordModelFromRequest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $recordModel = parent::getRecordModelFromRequest($request);
              }
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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 'Vtiger_Record_Model' in method 'getRecordModelFromRequest'.
      Open

                  $recordModel = $this->record ?: Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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\Record' in method 'setRelatedFieldsInHierarchy'.
      Open

                                      $sourceType = \App\Record::getType($relFieldValue);
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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

      Call to undeclared method \Vtiger_SaveAjax_Action::addCustomResult
      Open

                  $this->addCustomResult($result);
      Severity: Critical
      Found in modules/Vtiger/actions/SaveAjax.php by phan

      Argument 2 (field) is string but \App\ModuleHierarchy::getRelationFieldByHierarchy() takes bool|false defined at /code/app/ModuleHierarchy.php:166
      Open

              $relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.php by phan

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

      class Vtiger_SaveAjax_Action extends Vtiger_Save_Action

      The class Vtiger_SaveAjax_Action is not named in CamelCase.
      Open

      class Vtiger_SaveAjax_Action extends Vtiger_Save_Action
      {
          /**
           * Function process.
           *
      Severity: Minor
      Found in modules/Vtiger/actions/SaveAjax.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

           */

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

                  $this->invokeExposedMethod($mode, $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

           * @param \App\Request $request

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

          public function getRecordModelFromRequest(App\Request $request)

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

              return $this->record = $recordModel;

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

              $this->record->clearPrivilegesCache();

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

           * Function to get the record model based on the request parameters.

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

          {

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

                  $recordModel = parent::getRecordModelFromRequest($request);

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

           * @return \Vtiger_Record_Model

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

              $result['_recordId'] = $this->record->getId();

      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 ($relatedModule === $sourceModule) {

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

              if (method_exists($this, 'addCustomResult')) {

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

           * @param string               $fieldName

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

                          foreach ($relatedFields as $to => $from) {

      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->addCustomResult($result);

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

              $response->setEmitType(Vtiger_Response::$EMIT_JSON);

      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 ($fieldModelList as $fieldName => $fieldModel) {

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

              if ('QuickEdit' !== $request->getByType('fromView') && !$request->isEmpty('record')) {

      Line exceeds 120 characters; contains 136 characters
      Open

                  $recordModel = $this->record ?: Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $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

                              if ($relFieldValue && $relFieldModel && $toModel && $toModel->isWritable()) {

      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 ($relatedModules && !empty($fieldValue) && $recordModel->getPreviousValue($fieldName) !== $fieldValue) {

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

           * Function process.

      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

              if ($mode = $request->getMode()) {

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

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

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

                  }

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

                      'display_value' => $fieldModel->getDisplayValue($this->record->get($fieldName), $this->record->getId(), $this->record),

      Line exceeds 120 characters; contains 135 characters
      Open

                      'display_value' => $fieldModel->getDisplayValue($this->record->get($fieldName), $this->record->getId(), $this->record),

      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

                  $sourceModule = \App\Record::getType($fieldValue);

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

                                      $sourceType = \App\Record::getType($relFieldValue);

      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

                  return;

      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

              } 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

                          $relRecordModel = \Vtiger_Record_Model::getInstanceById($fieldValue, $sourceModule);

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

                              $relFieldValue = $relRecordModel->get($from[0]);

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

                                  if ($toModel->isReferenceField() || $relFieldModel->isReferenceField()) {

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

                                      $recordModel->set($toModel->getName(), $relFieldValue);

      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->getUITypeModel()->setValueFromRequest($request, $recordModel, '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

                              $toModel = $recordModel->getModule()->getFieldByName($to);

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

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

          /**

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

                  $recordModel = $this->record ?: Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());

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

              $fieldValue = $recordModel->get($fieldName);

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

                  if (false !== ($recordFieldValuePrev = $this->record->getPreviousValue($fieldName))) {

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

                      'prev_display_value' => $prevDisplayValue,

      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

           * Replenishment of related fields.

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

           * @param \Vtiger_Record_Model $recordModel

      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($sourceType, $toModel->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

                  if ($fieldModel && $fieldModel->isEditable()) {

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

                          $recordModel = $this->setRelatedFieldsInHierarchy($recordModel, $fieldModel->getName());

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

                      }

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

              return $recordModel;

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

          }

      Line exceeds 120 characters; contains 127 characters
      Open

                      $prevDisplayValue = $fieldModel->getDisplayValue($recordFieldValuePrev, $this->record->getId(), $this->record);

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

              $result['_reload'] = \count($this->record->getPreviousValue()) > 1;

      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

              $relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);

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

                              $relFieldModel = $relRecordModel->getModule()->getFieldByName($from[0]);

      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->saveRecord($request);

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

              $result = [];

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

                      $prevDisplayValue = $fieldModel->getDisplayValue($recordFieldValuePrev, $this->record->getId(), $this->record);

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

                  $result[$fieldName] = [

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

                      'value' => \App\Purifier::encodeHtml($this->record->getRawValue($fieldName)),

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

                  $fieldModel = $recordModel->getModule()->getFieldByName($request->getByType('field', 2));

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

                      if ($request->getBoolean('setRelatedFields') && $fieldModel->isReferenceField()) {

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

                                          $recordModel->set($toModel->getName(), $relFieldValue);

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

          public function process(App\Request $request)

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

              $fieldModelList = $this->record->getModule()->getFields();

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

                      continue;

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

                  $prevDisplayValue = false;

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

              $result['_recordLabel'] = $this->record->getName();

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

              $result['_isEditable'] = $this->record->isEditable();

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

              $result['_isViewable'] = $this->record->isViewable();

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

           *

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

           * @return Vtiger_Record_Model or Module specific Record Model instance

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

          public function setRelatedFieldsInHierarchy(Vtiger_Record_Model $recordModel, $fieldName)

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

                  foreach ($relatedModules as $relatedModule => $relatedFields) {

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

                                      }

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

              }

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

      class Vtiger_SaveAjax_Action extends Vtiger_Save_Action

      There are no issues that match your filters.

      Category
      Status