YetiForceCompany/YetiForceCRM

View on GitHub
modules/Import/actions/Data.php

Summary

Maintainability
F
1 wk
Test Coverage
F
2%

Function importRecords has a Cognitive Complexity of 111 (exceeds 5 allowed). Consider refactoring.
Open

    public function importRecords()
    {
        $moduleName = $this->module;
        $tableName = Import_Module_Model::getDbTableName($this->user);

Severity: Minor
Found in modules/Import/actions/Data.php - About 2 days 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

File Data.php has 579 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/* +***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
Severity: Major
Found in modules/Import/actions/Data.php - About 1 day to fix

    Method importRecords has 151 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function importRecords()
        {
            $moduleName = $this->module;
            $tableName = Import_Module_Model::getDbTableName($this->user);
    
    
    Severity: Major
    Found in modules/Import/actions/Data.php - About 6 hrs to fix

      Function transformInventoryFieldFromMap has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          public function transformInventoryFieldFromMap($value, $mapData)
          {
              if (!empty($value)) {
                  if ($this->currentInventoryRawData['name']) {
                      [$entityName] = $this->transformInventoryReference($this->currentInventoryRawData['name'], true);
      Severity: Minor
      Found in modules/Import/actions/Data.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

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

      class Import_Data_Action extends \App\Controller\Action
      {
          public $id;
          public $user;
          public $module;
      Severity: Minor
      Found in modules/Import/actions/Data.php by phpmd

      The class Import_Data_Action has 18 public methods. Consider refactoring Import_Data_Action to keep number of public methods under 10.
      Open

      class Import_Data_Action extends \App\Controller\Action
      {
          public $id;
          public $user;
          public $module;
      Severity: Minor
      Found in modules/Import/actions/Data.php by phpmd

      TooManyPublicMethods

      Since: 0.1

      A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      Example

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

      Function transformInventoryForImport has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public function transformInventoryForImport($inventoryData)
          {
              $inventoryModel = Vtiger_Inventory_Model::getInstance($this->module);
              $inventoryFields = $inventoryModel->getFields();
              $maps = $inventoryModel->getAutoCompleteFields();
      Severity: Minor
      Found in modules/Import/actions/Data.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

      Function getDefaultFieldValues has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getDefaultFieldValues()
          {
              $key = $this->module . '_' . $this->user->getId();
              if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
                  return \App\Cache::staticGet('DefaultFieldValues', $key);
      Severity: Minor
      Found in modules/Import/actions/Data.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

      Import_Data_Action has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Import_Data_Action extends \App\Controller\Action
      {
          public $id;
          public $user;
          public $module;
      Severity: Minor
      Found in modules/Import/actions/Data.php - About 2 hrs to fix

        Function getImportDetails has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getImportDetails(App\User $user, $forModule)
            {
                $db = App\Db::getInstance();
                $importRecords = [];
                $tableName = Import_Module_Model::getDbTableName($user);
        Severity: Minor
        Found in modules/Import/actions/Data.php - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            public function getDefaultFieldValues()
            {
                $key = $this->module . '_' . $this->user->getId();
                if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
                    return \App\Cache::staticGet('DefaultFieldValues', $key);
        Severity: Minor
        Found in modules/Import/actions/Data.php - About 1 hr to fix

          Method getImportStatusCount has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getImportStatusCount()
              {
                  $statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,
                      'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
                  $tableName = Import_Module_Model::getDbTableName($this->user);
          Severity: Minor
          Found in modules/Import/actions/Data.php - About 1 hr to fix

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

                public function transformInventoryForImport($inventoryData)
                {
                    $inventoryModel = Vtiger_Inventory_Model::getInstance($this->module);
                    $inventoryFields = $inventoryModel->getFields();
                    $maps = $inventoryModel->getAutoCompleteFields();
            Severity: Minor
            Found in modules/Import/actions/Data.php - About 1 hr to fix

              Method transformInventoryFieldFromMap has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function transformInventoryFieldFromMap($value, $mapData)
                  {
                      if (!empty($value)) {
                          if ($this->currentInventoryRawData['name']) {
                              [$entityName] = $this->transformInventoryReference($this->currentInventoryRawData['name'], true);
              Severity: Minor
              Found in modules/Import/actions/Data.php - About 1 hr to fix

                Method getImportDetails has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getImportDetails(App\User $user, $forModule)
                    {
                        $db = App\Db::getInstance();
                        $importRecords = [];
                        $tableName = Import_Module_Model::getDbTableName($user);
                Severity: Minor
                Found in modules/Import/actions/Data.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                                                      if ('' === $fieldValue && '' !== $currentValue && null !== $currentValue) {
                                                          $forUnset[] = $fieldName;
                                                      } elseif ('' === $fieldValue && ('' === $currentValue || null === $currentValue) && isset($defaultMandatoryFieldValues[$fieldName]) && '' !== $defaultMandatoryFieldValues[$fieldName]) {
                                                          $fieldValue = $defaultMandatoryFieldValues[$fieldName];
                                                      }
                  Severity: Major
                  Found in modules/Import/actions/Data.php - About 1 hr to fix

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

                        public function getDefaultMandatoryFieldValues()
                        {
                            $key = $this->module . '_' . $this->user->getId();
                            if (\App\Cache::staticHas('DefaultMandatoryFieldValues', $key)) {
                                return \App\Cache::staticGet('DefaultMandatoryFieldValues', $key);
                    Severity: Minor
                    Found in modules/Import/actions/Data.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 getImportStatusCount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getImportStatusCount()
                        {
                            $statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,
                                'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
                            $tableName = Import_Module_Model::getDbTableName($this->user);
                    Severity: Minor
                    Found in modules/Import/actions/Data.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 getImportRecordStatus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getImportRecordStatus($value)
                        {
                            $temp_status = '';
                            switch ($value) {
                                case 'created':
                    Severity: Minor
                    Found in modules/Import/actions/Data.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

                    Method updateRecordByModel has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function updateRecordByModel($record, $fieldData, $moduleName = false, ?int $relationId = 0, ?int $sourceId = 0)
                    Severity: Minor
                    Found in modules/Import/actions/Data.php - About 35 mins to fix

                      Function transformInventoryReference has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function transformInventoryReference($value, $getArray = false)
                          {
                              $value = trim($value);
                              if (!empty($value)) {
                                  if (strpos($value, '::::') > 0) {
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 createRecordByModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function createRecordByModel($moduleName, $fieldData, ?int $relationId = 0, ?int $sourceId = 0)
                          {
                              $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
                              if (isset($fieldData['inventoryData'])) {
                                  $inventoryData = $fieldData['inventoryData'];
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 getDefaultFieldValues() has an NPath complexity of 250. The configured NPath complexity threshold is 200.
                      Open

                          public function getDefaultFieldValues()
                          {
                              $key = $this->module . '_' . $this->user->getId();
                              if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
                                  return \App\Cache::staticGet('DefaultFieldValues', $key);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 importRecords() has an NPath complexity of 412612. The configured NPath complexity threshold is 200.
                      Open

                          public function importRecords()
                          {
                              $moduleName = $this->module;
                              $tableName = Import_Module_Model::getDbTableName($this->user);
                      
                      
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 importRecords() has 169 lines of code. Current threshold is set to 100. Avoid really long methods.
                      Open

                          public function importRecords()
                          {
                              $moduleName = $this->module;
                              $tableName = Import_Module_Model::getDbTableName($this->user);
                      
                      
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

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

                          public function transformInventoryFieldFromMap($value, $mapData)
                          {
                              if (!empty($value)) {
                                  if ($this->currentInventoryRawData['name']) {
                                      [$entityName] = $this->transformInventoryReference($this->currentInventoryRawData['name'], true);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 getDefaultFieldValues() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function getDefaultFieldValues()
                          {
                              $key = $this->module . '_' . $this->user->getId();
                              if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
                                  return \App\Cache::staticGet('DefaultFieldValues', $key);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 importRecords() has a Cyclomatic Complexity of 50. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function importRecords()
                          {
                              $moduleName = $this->module;
                              $tableName = Import_Module_Model::getDbTableName($this->user);
                      
                      
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 23 to the 15 allowed.
                      Open

                          public function transformInventoryForImport($inventoryData)
                      Severity: Critical
                      Found in modules/Import/actions/Data.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

                      This function "importRecords" has 168 lines, which is greater than the 150 lines authorized. Split it into smaller functions.
                      Open

                          public function importRecords()
                      Severity: Major
                      Found in modules/Import/actions/Data.php by sonar-php

                      A function that grows too large tends to aggregate too many responsibilities.

                      Such functions inevitably become harder to understand and therefore harder to maintain.

                      Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.

                      Those smaller functions will not only be easier to understand, but also probably easier to test.

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

                          public function getDefaultFieldValues()
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 129 to the 15 allowed.
                      Open

                          public function importRecords()
                      Severity: Critical
                      Found in modules/Import/actions/Data.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

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

                      class Import_Data_Action extends \App\Controller\Action
                      Severity: Major
                      Found in modules/Import/actions/Data.php by sonar-php

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

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

                          public function transformInventoryFieldFromMap($value, $mapData)
                      Severity: Critical
                      Found in modules/Import/actions/Data.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

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

                      class Import_Data_Action extends \App\Controller\Action
                      {
                          public $id;
                          public $user;
                          public $module;
                      Severity: Minor
                      Found in modules/Import/actions/Data.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

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

                          public function transformInventoryReference($value, $getArray = false)
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

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

                      Example

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

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

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

                              $query = (new \App\Db\Query())->select(['temp_status'])->from($tableName);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 '56', column '14').
                      Open

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

                                      $queryGenerator = new App\QueryGenerator($moduleName, $this->user->getId());
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      MissingImport

                      Since: 2.7.0

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

                      Example

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

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

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

                          public function updateRecordByModel($record, $fieldData, $moduleName = false, ?int $relationId = 0, ?int $sourceId = 0)
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

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

                      Example

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

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

                      Missing class import via use statement (line '229', column '32').
                      Open

                                      $inventoryFieldData = (new \App\Db\Query())->from($inventoryTableName)->where(['id' => $rowId])->all();
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 '609', column '16').
                      Open

                              $query = new \App\Db\Query();
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 '211', column '16').
                      Open

                              $query = new \App\Db\Query();
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Lock_Action' in method 'initializeImport'.
                      Open

                              $lockInfo = Import_Lock_Action::isLockedForModule($this->module);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'runScheduledImport'.
                      Open

                                      'module' => App\Language::translate($importDataController->module, $importDataController->module),
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Queue_Action' in method 'getScheduledImport'.
                      Open

                              $importQueue = Import_Queue_Action::getAll(Import_Queue_Action::$IMPORT_STATUS_SCHEDULED);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'transformInventoryReference'.
                      Open

                                      $value = \App\Record::getCrmIdByLabel($referenceModuleName, $entityLabel);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\Vtiger_Record_Model' in method 'getImportDetails'.
                      Open

                                      $record = \Vtiger_Record_Model::getCleanInstance($forModule);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Record_Model' in method 'updateRecordByModel'.
                      Open

                              $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Lock_Action' in method 'initializeImport'.
                      Open

                              Import_Lock_Action::lock($this->id, $this->module, $this->user);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Queue_Action' in method 'finishImport'.
                      Open

                              Import_Queue_Action::remove($this->id);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Record_Model' in method 'importRecords'.
                      Open

                                                      $this->addRelation($row['relation_id'], $row['src_record'], Vtiger_Record_Model::getInstanceById($baseRecordId));
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 transformInventoryFieldFromMap uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                      } else {
                                          $value = '';
                                      }
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      ElseExpression

                      Since: 1.4.0

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

                      Example

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

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

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

                              if (\App\Cache::staticHas('DefaultMandatoryFieldValues', $key)) {
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Module_Model' in method 'getDefaultMandatoryFieldValues'.
                      Open

                              $moduleModel = Vtiger_Module_Model::getInstance($this->module);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\Json' in method 'transformInventoryForImport'.
                      Open

                                              $data['currencyparam'] = \App\Json::encode($newCurrencyParam);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                              $db = App\Db::getInstance();
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                              \App\Cache::staticSave('DefaultFieldValues', $key, $defaultValue);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Module_Model' in method 'importRecords'.
                      Open

                                  $inventoryTableName = Import_Module_Model::getInventoryDbTableName($this->user);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 transformInventoryFieldFromMap uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                      } else {
                                          $moduleObject = vtlib\Module::getInstance($entityName);
                                          $fieldObject = $moduleObject ? Vtiger_Field_Model::getInstance($mapData['field'], $moduleObject) : null;
                                          if (!\is_array($this->inventoryFieldMapData[$mapData['field']])) {
                                              $this->inventoryFieldMapData[$mapData['field']] = [];
                      Severity: Minor
                      Found in modules/Import/actions/Data.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_Field_Model' in method 'transformInventoryFieldFromMap'.
                      Open

                                          $fieldObject = $moduleObject ? Vtiger_Field_Model::getInstance($mapData['field'], $moduleObject) : null;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\Json' in method 'getDefaultMandatoryFieldValues'.
                      Open

                                  $this->defaultValues = \App\Json::decode($this->defaultValues);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'importRecords'.
                      Open

                                                  $ownerId = \App\User::getUserIdByFullName(trim($comparisonValue));
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Record_Model' in method 'importRecords'.
                      Open

                                                  $recordModel = Vtiger_Record_Model::getInstanceById($baseRecordId);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Record_Model' in method 'importRecords'.
                      Open

                                                  $recordModel = Vtiger_Record_Model::getInstanceById($baseRecordId);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 importRecords uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                      } else {
                                          $entityInfo = $this->createRecordByModel($moduleName, $fieldData, $row['relation_id'] ?? 0, $row['src_record'] ?? 0);
                                      }
                      Severity: Minor
                      Found in modules/Import/actions/Data.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\Fields\Currency' in method 'transformInventoryForImport'.
                      Open

                                              $value = \App\Fields\Currency::getCurrencyIdByName($value);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'vtlib\Module' in method 'transformInventoryFieldFromMap'.
                      Open

                                          $moduleObject = vtlib\Module::getInstance($entityName);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Record_Model' in method 'createRecordByModel'.
                      Open

                              $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                              if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Module_Model' in method 'getDefaultFieldValues'.
                      Open

                              $moduleModel = Vtiger_Module_Model::getInstance($this->module);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                              \App\Cache::staticSave('DefaultMandatoryFieldValues', $key, $defaultMandatoryValues);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'importRecords'.
                      Open

                                  $importBatchLimit = \App\Config::module('Import', 'BATCH_LIMIT');
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'importRecords'.
                      Open

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

                                              } else {
                                                  $referenceFileValueComponents = explode(':::', $comparisonValue);
                                              }
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Module_Model' in method 'getImportStatusCount'.
                      Open

                              $tableName = Import_Module_Model::getDbTableName($this->user);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                                  return \App\Cache::staticGet('DefaultMandatoryFieldValues', $key);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Module_Model' in method 'getImportDetails'.
                      Open

                                  $moduleModel = Vtiger_Module_Model::getInstance($forModule);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Record_Model' in method 'addRelation'.
                      Open

                              $sourceRecord = \App\Record::isExists($sourceId) ? Vtiger_Record_Model::getInstanceById($sourceId) : null;
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 importRecords uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                      } else {
                                          $createRecord = true;
                                      }
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Module_Model' in method 'getImportDetails'.
                      Open

                              $tableName = Import_Module_Model::getDbTableName($user);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Module_Model' in method 'updateImportStatus'.
                      Open

                              $tableName = Import_Module_Model::getDbTableName($this->user);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Module_Model' in method 'importRecords'.
                      Open

                              $tableName = Import_Module_Model::getDbTableName($this->user);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Record_Model' in method 'importRecords'.
                      Open

                                                  $recordModel = Vtiger_Record_Model::getInstanceById($baseRecordId);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Module_Model' in method 'transformForImport'.
                      Open

                              $moduleModel = Vtiger_Module_Model::getInstance($this->module);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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\Mailer' in method 'runScheduledImport'.
                      Open

                                  \App\Mailer::sendFromTemplate([
                                      'to' => [$importDataController->user->getDetail('email1') => $importDataController->user->getName()],
                                      'template' => 'ImportCron',
                                      'imported' => $importStatusCount['IMPORTED'],
                                      'total' => $importStatusCount['TOTAL'],
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\Json' in method 'getDefaultFieldValues'.
                      Open

                                      $this->defaultValues = \App\Json::decode($this->defaultValues);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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\Purifier' in method 'importRecords'.
                      Open

                                      $fieldData[$fieldName] = \App\Purifier::decodeHtml($row[$fieldName]);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'importRecords'.
                      Open

                                              $ownerId = \App\User::getUserIdByName(trim($comparisonValue));
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'getScheduledImport'.
                      Open

                                  $scheduledImports[$importId] = new self($importInfo, \App\User::getUserModel($importInfo['user_id']));
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Utils_Helper' in method 'initializeImport'.
                      Open

                                      Import_Utils_Helper::showImportLockedError($lockInfo);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Import_Lock_Action' in method 'finishImport'.
                      Open

                              Import_Lock_Action::unLock($this->user, $this->module);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'Vtiger_Module_Model' in method 'importRecords'.
                      Open

                              $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 importRecords uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $createRecord = true;
                                  }
                      Severity: Minor
                      Found in modules/Import/actions/Data.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_Inventory_Model' in method 'transformInventoryForImport'.
                      Open

                              $inventoryModel = Vtiger_Inventory_Model::getInstance($this->module);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'runScheduledImport'.
                      Open

                                  App\User::setCurrentUserId($importDataController->user->getId());
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'addRelation'.
                      Open

                              $sourceRecord = \App\Record::isExists($sourceId) ? Vtiger_Record_Model::getInstanceById($sourceId) : null;
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 'Users_Privileges_Model' in method 'checkPermission'.
                      Open

                              $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                                  return \App\Cache::staticGet('DefaultFieldValues', $key);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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\Currency' in method 'transformInventoryForImport'.
                      Open

                                                  $valueData = \App\Fields\Currency::getCurrencyIdByName($key);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 getImportDetails uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                      } else {
                                          $importRecords['failed'][] = $record;
                                      }
                      Severity: Minor
                      Found in modules/Import/actions/Data.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_Relation_Model' in method 'addRelation'.
                      Open

                              $relationModel = Vtiger_Relation_Model::getInstanceById($relationId);
                      Severity: Minor
                      Found in modules/Import/actions/Data.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 "MERGED" 3 times.
                      Open

                                  'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "SKIPPED" 3 times.
                      Open

                                  'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "temp_status" 5 times.
                      Open

                              \App\Db::getInstance()->createCommand()->update($tableName, ['temp_status' => $entityInfo['status'], 'recordid' => $entityId], ['id' => $entryId])->execute();
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "DefaultFieldValues" 3 times.
                      Open

                              if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "skipped" 3 times.
                      Open

                                      'skipped' => $importStatusCount['SKIPPED'],
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "reference" 3 times.
                      Open

                                      } elseif (!\in_array($fieldInstance->getFieldDataType(), ['datetime', 'date', 'time', 'reference'])) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "status" 7 times.
                      Open

                              \App\Db::getInstance()->createCommand()->update($tableName, ['temp_status' => $entityInfo['status'], 'recordid' => $entityId], ['id' => $entryId])->execute();
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "relation_id" 6 times.
                      Open

                                                  if ($row['relation_id'] ?? null) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "UPDATED" 3 times.
                      Open

                                  'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "IMPORTED" 5 times.
                      Open

                              $statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "field" 7 times.
                      Open

                                      if ($this->inventoryFieldMapData[$mapData['field']] && $this->inventoryFieldMapData[$mapData['field']][$entityName]) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "inventoryData" 8 times.
                      Open

                                          $fieldData['inventoryData'] = $inventoryFieldData;
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "src_record" 5 times.
                      Open

                                                      $this->addRelation($row['relation_id'], $row['src_record'], Vtiger_Record_Model::getInstanceById($baseRecordId));
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "CREATED" 3 times.
                      Open

                                  'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "DefaultMandatoryFieldValues" 3 times.
                      Open

                              if (\App\Cache::staticHas('DefaultMandatoryFieldValues', $key)) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "failed" 3 times.
                      Open

                                      'failed' => $importStatusCount['FAILED'],
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "FAILED" 3 times.
                      Open

                              $statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,
                      Severity: Critical
                      Found in modules/Import/actions/Data.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" 3 times.
                      Open

                                      if ('owner' === $fieldInstance->getFieldDataType()) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.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 "TOTAL" 3 times.
                      Open

                              $statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by sonar-php

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

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

                      Noncompliant Code Example

                      With the default threshold of 3:

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

                      Compliant Solution

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

                      Exceptions

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

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

                                      foreach ($importRecords['headers'] as $columnName => $header) {
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      UnusedLocalVariable

                      Since: 0.2

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

                      Example

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

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

                      Parameter $user has undeclared type \App\User (Did you mean class \Tests\App\User)
                      Open

                          public function __construct($importInfo, App\User $user)
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                              if (!$currentUserPrivilegesModel->hasModulePermission($request->getModule())) {
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                              $key = $this->module . '_' . $this->user->getId();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                          $defaultValue[$fieldName] = $this->user->getId();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                          $defaultValue[$mandatoryFieldName] = $this->user->getId();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Argument 1 (encodedValue) is array{} but \App\Json::decode() takes string defined at /code/app/Json.php:37
                      Open

                                      $this->defaultValues = \App\Json::decode($this->defaultValues);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                              $key = $this->module . '_' . $this->user->getId();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Returning type array{TOTAL:0,IMPORTED:0,FAILED:0,PENDING:0,CREATED:0,SKIPPED:0,UPDATED:0,MERGED:0} but getImportStatusCount() is declared to return int
                      Open

                              return $statusCount;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Argument 2 (module) is \vtlib\Module|\vtlib\ModuleBasic but \Vtiger_Field_Model::getInstance() takes \Vtiger_Module_Model|false defined at /code/modules/Vtiger/models/Field.php:1158
                      Open

                                          $fieldObject = $moduleObject ? Vtiger_Field_Model::getInstance($mapData['field'], $moduleObject) : null;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Call to method count from undeclared class \yii\db\DataReader
                      Open

                              if ($dataReader->count()) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Suspicious array access to null
                      Open

                                                  $entityInfo['status'] = self::IMPORT_RECORD_SKIPPED;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Call to undeclared method \Vtiger_Basic_InventoryField::getCurrencyParam
                      Open

                                              $currencyParam = $fieldInstance->getCurrencyParam([], $currencyParam);
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                  $scheduledImports[$importId] = new self($importInfo, \App\User::getUserModel($importInfo['user_id']));
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Suspicious array access to null
                      Open

                                                  $entityInfo['status'] = self::IMPORT_RECORD_UPDATED;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      null passed to foreach instead of array
                      Open

                              foreach ($inventoryData as &$data) {
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                              $query->from($tableName)->where(['temp_status' => self::IMPORT_RECORD_NONE]);
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
                      Open

                                      $queryGenerator = new App\QueryGenerator($moduleName, $this->user->getId());
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Suspicious array access to null
                      Open

                                                  $entityInfo['status'] = self::IMPORT_RECORD_MERGED;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                              $query = (new \App\Db\Query())->select(['temp_status'])->from($tableName);
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Doc-block of $sourceId in addRelation contains phpdoc param type null which is incompatible with the param type int declared in the signature
                      Open

                           * @param int|null            $sourceId
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
                      Open

                                      $query = $queryGenerator->createQuery();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                                  $ownerId = \App\Fields\Owner::getGroupId($comparisonValue);
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Reference to undeclared property \Import_Data_Action->currentInventoryRawData
                      Open

                                  if ($this->currentInventoryRawData['name']) {
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Call to undeclared method \Vtiger_Field_Model::getValuesName
                      Open

                                              $picklist = $fieldObject->getValuesName();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                              \App\Db::getInstance()->createCommand()->update($tableName, ['temp_status' => $entityInfo['status'], 'recordid' => $entityId], ['id' => $entryId])->execute();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      When appending to a value of type array{}, found an array access index of type \App\Fields\type, but expected the index to be of type int|string
                      Open

                                                      $newCurrencyParam[$valueData] = $currencyData;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Reference to undeclared property \Import_Data_Action->currentInventoryRawData
                      Open

                                      [$entityName] = $this->transformInventoryReference($this->currentInventoryRawData['name'], true);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Saw an @param annotation for fieldInstance, but it was not found in the param list of function transformInventoryReference(mixed $value, false|mixed $getArray = null) : mixed
                      Open

                           * @param \Vtiger_Field_Model $fieldInstance
                      Severity: Info
                      Found in modules/Import/actions/Data.php by phan

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

                                  if ($lockInfo['userid'] != $this->user->getId()) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method read from undeclared class \yii\db\DataReader
                      Open

                              while ($row = $dataReader->read()) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method getModuleFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
                      Open

                                      $moduleFields = $queryGenerator->getModuleFields();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method close from undeclared class \yii\db\DataReader
                      Open

                              $dataReader->close();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Reference to undeclared property \Import_Data_Action->currentInventoryRawData
                      Open

                                  $this->currentInventoryRawData = $data;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Reference to undeclared property \Import_Data_Action->currentInventoryRawData
                      Open

                              $this->currentInventoryRawData = [];
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                                          $importRecords['headers'][$fieldName] = $moduleModel->getFieldByName($fieldName)->getFieldLabel();
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

                      Argument 1 (encodedValue) is array{} but \App\Json::decode() takes string defined at /code/app/Json.php:37
                      Open

                                  $this->defaultValues = \App\Json::decode($this->defaultValues);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                                              $ownerId = \App\User::getUserIdByName(trim($comparisonValue));
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method addCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
                      Open

                                          $queryGenerator->addCondition($mergeField, $comparisonValue, 'e');
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Parameter $user has undeclared type \App\User (Did you mean class \Tests\App\User)
                      Open

                          public static function getImportDetails(App\User $user, $forModule)
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                                  $query->limit($importBatchLimit);
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                      $queryGenerator = new App\QueryGenerator($moduleName, $this->user->getId());
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                                  $ownerId = \App\User::getUserIdByFullName(trim($comparisonValue));
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Saw misspelled annotation @returns. Did you mean @return?
                      Open

                           * @returns array Import Records with the list of skipped records and failed records
                      Severity: Info
                      Found in modules/Import/actions/Data.php by phan

                      Call to method read from undeclared class \yii\db\DataReader
                      Open

                                  while ($row = $dataReader->read()) {
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method getInstance from undeclared class \App\Fields\RecordNumber (Did you mean class \Tests\Base\RecordNumber)
                      Open

                              \App\Fields\RecordNumber::getInstance($this->module)->updateRecords();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Suspicious array access to null
                      Open

                                                  $entityInfo['status'] = self::IMPORT_RECORD_MERGED;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                              $query->from($tableName)->where(['temp_status' => [self::IMPORT_RECORD_SKIPPED, self::IMPORT_RECORD_FAILED]]);
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                      $defaultMandatoryValues[$mandatoryFieldName] = $this->user->getId();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
                      Open

                                      $queryGenerator->setFields(['id']);
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                      $inventoryFieldData = (new \App\Db\Query())->from($inventoryTableName)->where(['id' => $rowId])->all();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Saw an @param annotation for fieldValue, but it was not found in the param list of function transformInventoryReference(mixed $value, false|mixed $getArray = null) : mixed
                      Open

                           * @param string              $fieldValue
                      Severity: Info
                      Found in modules/Import/actions/Data.php by phan

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

                                  App\User::setCurrentUserId($importDataController->user->getId());
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

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

                                  $columnNames = $db->getTableSchema($tableName, true)->getColumnNames();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Call to method close from undeclared class \yii\db\DataReader
                      Open

                                  $dataReader->close();
                      Severity: Critical
                      Found in modules/Import/actions/Data.php by phan

                      Default value for string $moduleName can't be false
                      Open

                          public function updateRecordByModel($record, $fieldData, $moduleName = false, ?int $relationId = 0, ?int $sourceId = 0)
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phan

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

                                                  $defaultMandatoryFieldValues = $this->getDefaultMandatoryFieldValues();
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      LongVariable

                      Since: 0.2

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

                      Example

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

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

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

                          protected $inventoryFieldMapData = [];
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      LongVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $defaultMandatoryValues = [];
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      LongVariable

                      Since: 0.2

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

                      Example

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

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

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

                                                  $referenceFileValueComponents = explode('::::', $comparisonValue);
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      LongVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      LongVariable

                      Since: 0.2

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

                      Example

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

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

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

                      class Import_Data_Action extends \App\Controller\Action

                      The class Import_Data_Action is not named in CamelCase.
                      Open

                      class Import_Data_Action extends \App\Controller\Action
                      {
                          public $id;
                          public $user;
                          public $module;
                      Severity: Minor
                      Found in modules/Import/actions/Data.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

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

                              $ID = $recordModel->getId();
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $db = App\Db::getInstance();
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                          public $id;
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                          const IMPORT_RECORD_SKIPPED = 2;

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

                          const IMPORT_RECORD_FAILED = 5;

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

                          /** {@inheritdoc} */

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

                              }

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

                              \App\Cache::staticSave('DefaultFieldValues', $key, $defaultValue);

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

                          }

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

                           * Get default mandatory field values.

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

                              if (!empty($this->defaultValues) && !\is_array($this->defaultValues)) {

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

                              $moduleModel = Vtiger_Module_Model::getInstance($this->module);

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

                              $this->importRecords();

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

                                  return true;

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

                          protected $inventoryFieldMapData = [];

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

                          const IMPORT_RECORD_NONE = 0;

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

                              $this->module = $importInfo['module'];

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

                              $defaultValue = [];

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

                              $key = $this->module . '_' . $this->user->getId();

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

                                  $fieldDefaultValue = $fieldInstance->getDefaultFieldValue();

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

                                  if (!empty($this->defaultValues[$mandatoryFieldName])) {

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

                                  } elseif (!empty($fieldDefaultValue)) {

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

                              \App\Cache::staticSave('DefaultMandatoryFieldValues', $key, $defaultMandatoryValues);

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

                      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 \App\Cache::staticGet('DefaultMandatoryFieldValues', $key);

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

                                  $this->defaultValues = \App\Json::decode($this->defaultValues);

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

                                  } elseif (!\in_array($fieldInstance->getFieldDataType(), ['datetime', 'date', 'time', 'reference'])) {

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

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

                          public function __construct($importInfo, App\User $user)

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

                              }

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

                                      } elseif (!empty($fieldDefaultValue)) {

                      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 $fieldMapping;

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

                          const IMPORT_RECORD_MERGED = 4;

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

                              $this->defaultValues = $importInfo['default_values'];

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

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

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

                                  if ($this->defaultValues) {

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

                              $moduleModel = Vtiger_Module_Model::getInstance($this->module);

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

                                  $mandatoryFieldName = $fieldInstance->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 array

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

                          public $defaultValues = [];

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

                              foreach ($moduleModel->getMandatoryFieldModels() as $fieldInstance) {

                      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->id = $importInfo['id'];

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

                          {

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

                              $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

                                  return \App\Cache::staticGet('DefaultFieldValues', $key);

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

                              }

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

                                  if (empty($defaultValue[$mandatoryFieldName])) {

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

                                          $defaultValue[$fieldName] = $this->user->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

                              $defaultMandatoryValues = [];

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

                              $this->finishImport();

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

                          {

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

                           * @param array     $importInfo

                      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 array

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

                          /**

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

                                  } elseif ('owner' === $fieldInstance->getFieldDataType()) {

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

                                      $defaultMandatoryValues[$mandatoryFieldName] = $this->user->getId();

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

                                      $defaultMandatoryValues[$mandatoryFieldName] = '????';

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

                          public $mergeType;

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

                          public $entitydata = [];

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

                           * Constructor.

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

                                      $this->defaultValues = \App\Json::decode($this->defaultValues);

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

                                      } elseif (!\in_array($fieldInstance->getFieldDataType(), ['datetime', 'date', 'time', 'reference'])) {

                      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\Cache::staticHas('DefaultMandatoryFieldValues', $key)) {

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

                                  $mandatoryFieldName = $fieldInstance->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

                          public $importedRecordInfo = [];

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

                          /**

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

                                          $defaultValue[$mandatoryFieldName] = $this->user->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

                              }

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

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

                              $lockInfo = Import_Lock_Action::isLockedForModule($this->module);

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

                                  if ($lockInfo['userid'] != $this->user->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

                                  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

                          public function getDefaultFieldValues()

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

                                      if ('owner' === $fieldInstance->getFieldDataType()) {

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

                                          $defaultValue[$mandatoryFieldName] = '????';

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

                                      if (52 === $fieldInstance->getUIType()) {

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

                                  return false;

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

                              Import_Lock_Action::lock($this->id, $this->module, $this->user);

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

                          public $module;

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

                          public $type;

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

                          public $mergeFields;

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

                          const IMPORT_RECORD_CREATED = 1;

                      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->mergeFields = $importInfo['merge_fields'];

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

                                      $defaultValue = $this->defaultValues;

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

                              }

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

                                  $fieldDefaultValue = $fieldInstance->getDefaultFieldValue();

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

                          public function getDefaultMandatoryFieldValues()

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

                              $this->mergeType = $importInfo['merge_type'];

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

                          public function import()

                      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 ($lockInfo) {

                      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

                                      return false;

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

                                  if (!\is_array($this->defaultValues)) {

                      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 $defaultValue;

                      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->initializeImport()) {

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

                                      Import_Utils_Helper::showImportLockedError($lockInfo);

                      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 $batchImport = true;

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

                          /** {@inheritdoc} */

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

                          {

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

                              if (\App\Cache::staticHas('DefaultFieldValues', $key)) {

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

                              foreach ($moduleModel->getMandatoryFieldModels() as $fieldInstance) {

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

                              foreach ($moduleModel->getFields() as $fieldName => $fieldInstance) {

                      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 $id;

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

                          public $user;

                      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

                              if (!empty($this->defaultValues)) {

                      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($defaultValue[$fieldName])) {

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

                           *

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

                           */

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

                                  }

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

                              return $defaultMandatoryValues;

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

                           */

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

                          const IMPORT_RECORD_UPDATED = 3;

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

                           * @param \App\User $user

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

                          {

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

                           * Get default field values.

                      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

                                          $defaultValue[$fieldName] = $fieldDefaultValue;

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

                                      $defaultMandatoryValues[$mandatoryFieldName] = $fieldDefaultValue;

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

                              $this->importData();

                      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

                              $query = new \App\Db\Query();

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

                                  $importBatchLimit = \App\Config::module('Import', 'BATCH_LIMIT');

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

                                  $mergeTypeValue = $this->mergeType;

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

                                          $queryGenerator->addCondition($mergeField, $comparisonValue, 'e');

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

                                      $query = $queryGenerator->createQuery();

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

                                                      if (\in_array($fieldName, $mandatoryFieldNames)) {

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

                                                          if ('' === $fieldValue && '' !== $currentValue && null !== $currentValue) {

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

                                                  // only if actual record field is empty and file field is empty too

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

                                                          $fieldValue = $defaultFieldValues[$fieldName];

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

                                                  }

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

                                                  $fieldData = $this->transformForImport($fieldData);

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

                                                  $this->updateRecordByModel($baseRecordId, $fieldData, $moduleName, $row['relation_id'] ?? 0, $row['src_record'] ?? 0);

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

                                  foreach ($this->fieldMapping as $fieldName => $index) {

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

                                          }

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

                                      $baseRecordId = $query->scalar();

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

                                      if ($baseRecordId) {

                      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->updateRecordByModel($baseRecordId, $fieldData, $moduleName, $row['relation_id'] ?? 0, $row['src_record'] ?? 0);

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

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

                      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->fieldMapping = $importInfo['field_mapping'];

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

                              $this->user = $user;

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

                          }

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

                              $key = $this->module . '_' . $this->user->getId();

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

                                      $defaultMandatoryValues[$mandatoryFieldName] = $this->defaultValues[$mandatoryFieldName];

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

                          }

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

                           * Import data.

                      Line exceeds 120 characters; contains 166 characters
                      Open

                              \App\Db::getInstance()->createCommand()->update($tableName, ['temp_status' => $entityInfo['status'], 'recordid' => $entityId], ['id' => $entryId])->execute();

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

                           */

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

                          public function importRecords()

                      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 (\count($referenceFileValueComponents) > 1) {

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

                                                  $recordModel = Vtiger_Record_Model::getInstanceById($baseRecordId);

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

                                                      unset($fieldData[$unsetName]);

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

                                                  // fill out empty values with defaults for all fields

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

                              return true;

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

                              \App\Fields\RecordNumber::getInstance($this->module)->updateRecords();

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

                              $moduleName = $this->module;

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

                                  if ($isInventory) {

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

                                      $inventoryFieldData = (new \App\Db\Query())->from($inventoryTableName)->where(['id' => $rowId])->all();

                      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 ($forUnset as $unsetName) {

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

                          public function finishImport()

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

                              $tableName = Import_Module_Model::getDbTableName($this->user);

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

                              $query->from($tableName)->where(['temp_status' => self::IMPORT_RECORD_NONE]);

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

                                  $fieldData = [];

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

                                              if (empty($ownerId)) {

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

                                                  $referenceFileValueComponents = explode(':::', $comparisonValue);

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

                                                  $comparisonValue = trim($referenceFileValueComponents[1]);

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

                                                  foreach ($fieldData as $fieldName => &$fieldValue) {

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

                                                  break;

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

                                                  break;

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

                                                  // only if actual record field is empty and file field is empty too

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

                                                  $defaultFieldValues = $this->getDefaultFieldValues();

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

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

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

                           * @param int   $entryId

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

                           * @return bool

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

                              $tableName = Import_Module_Model::getDbTableName($this->user);

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

                                  $rowId = $row['id'];

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

                                      $queryGenerator->setFields(['id']);

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

                                          if ('reference' == $fieldInstance->getFieldDataType()) {

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

                                          switch ($mergeTypeValue) {

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

                                                  $entityInfo['status'] = self::IMPORT_RECORD_UPDATED;

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

                                                  $entityInfo['status'] = self::IMPORT_RECORD_MERGED;

                      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 ($isInventory) {

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

                                      $fieldData[$fieldName] = \App\Purifier::decodeHtml($row[$fieldName]);

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

                                          $fieldInstance = $moduleFields[$mergeField];

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

                                              if (empty($ownerId)) {

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

                                                  $ownerId = \App\Fields\Owner::getGroupId($comparisonValue);

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

                                                  $referenceFileValueComponents = explode('::::', $comparisonValue);

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

                                              case Import_Module_Model::AUTO_MERGE_IGNORE:

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

                                                  }

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

                                                  $defaultFieldValues = $this->getDefaultFieldValues();

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

                                                  foreach ($fieldData as $fieldName => &$fieldValue) {

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

                                              case Import_Module_Model::AUTO_MERGE_EXISTINGISPRIORITY:

                      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

                                      $moduleFields = $queryGenerator->getModuleFields();

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

                                              $comparisonValue = $ownerId ?: 0;

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

                                                              $fieldValue = $defaultMandatoryFieldValues[$fieldName];

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

                                                  // fill out empty values with defaults for all fields

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

                                                  $recordModel = Vtiger_Record_Model::getInstanceById($baseRecordId);

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

                          }

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

                              \App\Db::getInstance()->createCommand()->update($tableName, ['temp_status' => $entityInfo['status'], 'recordid' => $entityId], ['id' => $entryId])->execute();

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

                              $moduleModel = Vtiger_Module_Model::getInstance($moduleName);

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

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

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

                                          if ('owner' == $fieldInstance->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

                                              } 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

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

                      Line exceeds 120 characters; contains 221 characters
                      Open

                                                          } elseif ('' === $fieldValue && ('' === $currentValue || null === $currentValue) && isset($defaultMandatoryFieldValues[$fieldName]) && '' !== $defaultMandatoryFieldValues[$fieldName]) {

                      Line exceeds 120 characters; contains 146 characters
                      Open

                                                  $this->updateRecordByModel($baseRecordId, $fieldData, $moduleName, $row['relation_id'] ?? 0, $row['src_record'] ?? 0);

                      Line exceeds 120 characters; contains 193 characters
                      Open

                                                      if ('' === $fieldValue && ('' === $currentValue || null === $currentValue) && isset($defaultFieldValues[$fieldName]) && '' !== $defaultFieldValues[$fieldName]) {

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

                                                  // remove empty values - do not modify existing

                      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 updateImportStatus($entryId, $entityInfo)

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

                              $isInventory = $moduleModel->isInventory();

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

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

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

                                      foreach ($this->mergeFields as $index => $mergeField) {

                      Line exceeds 120 characters; contains 145 characters
                      Open

                                                      $this->addRelation($row['relation_id'], $row['src_record'], Vtiger_Record_Model::getInstanceById($baseRecordId));

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

                                                  $forUnset = [];

                      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 ($fieldData as $fieldName => &$fieldValue) {

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

                              Import_Queue_Action::remove($this->id);

                      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 ($this->batchImport) {

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

                                      $queryGenerator = new App\QueryGenerator($moduleName, $this->user->getId());

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

                                              case Import_Module_Model::AUTO_MERGE_MERGEFIELDS:

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

                                                      if ('' === $fieldValue && ('' === $currentValue || null === $currentValue) && isset($defaultFieldValues[$fieldName]) && '' !== $defaultFieldValues[$fieldName]) {

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

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

                          }

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

                           * Import records.

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

                                  $query->limit($importBatchLimit);

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

                                                  $ownerId = \App\User::getUserIdByFullName(trim($comparisonValue));

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

                                                  $defaultMandatoryFieldValues = $this->getDefaultMandatoryFieldValues();

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

                                                  }

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

                                                  $fieldData = array_filter($fieldData, function ($fieldValue) {

                      Line exceeds 120 characters; contains 146 characters
                      Open

                                                  $this->updateRecordByModel($baseRecordId, $fieldData, $moduleName, $row['relation_id'] ?? 0, $row['src_record'] ?? 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

                           * Update import status.

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

                           * @param array $entityInfo

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

                                                  if ($row['relation_id'] ?? null) {

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

                                                              $forUnset[] = $fieldName;

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

                                                  $fieldData = $this->transformForImport($fieldData);

                      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

                                  $inventoryTableName = Import_Module_Model::getInventoryDbTableName($this->user);

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

                                  $createRecord = false;

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

                                  if (!empty($mergeTypeValue) && Import_Module_Model::AUTO_MERGE_NONE !== $mergeTypeValue) {

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

                                                  $entityInfo['status'] = self::IMPORT_RECORD_SKIPPED;

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

                                                  break;

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

                                                  $mandatoryFieldNames = array_keys($defaultMandatoryFieldValues);

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

                                                          } elseif ('' === $fieldValue && ('' === $currentValue || null === $currentValue) && isset($defaultMandatoryFieldValues[$fieldName]) && '' !== $defaultMandatoryFieldValues[$fieldName]) {

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

                                                  $recordModel = Vtiger_Record_Model::getInstanceById($baseRecordId);

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

                                                      if (null !== $currentValue && '' !== $currentValue) {

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

                                                          // existing record data is priority - do not override - save only empty record fields

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

                                                      } elseif ('' === $fieldValue && isset($defaultFieldValues[$fieldName]) && '' !== $defaultFieldValues[$fieldName]) {

                      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->updateImportStatus($rowId, $entityInfo);

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

                              return true;

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

                           * @throws \App\Exceptions\AppException

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

                              Import_Lock_Action::unLock($this->user, $this->module);

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

                                  unset($data['id']);

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

                          {

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

                                      if (isset($inventoryFields[$fieldName])) {

                      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 ($entityName) {

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

                                  $entityInfo = null;

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

                                      if ($this->inventoryFieldMapData[$mapData['field']] && $this->inventoryFieldMapData[$mapData['field']][$entityName]) {

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

                                          if (!\is_array($this->inventoryFieldMapData[$mapData['field']])) {

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

                                  }

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

                                              $ownerId = \App\User::getUserIdByName(trim($comparisonValue));

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

                                              if (strpos($comparisonValue, '::::') > 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

                                              case Import_Module_Model::AUTO_MERGE_OVERWRITE:

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

                                                      return '' !== $fieldValue;

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

                                                          $fieldValue = '';

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

                                              default:

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

                                          $inventoryFieldData = $this->transformInventoryForImport($inventoryFieldData);

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

                                      }

                      Line exceeds 120 characters; contains 137 characters
                      Open

                                          $entityInfo = $this->createRecordByModel($moduleName, $fieldData, $row['relation_id'] ?? 0, $row['src_record'] ?? 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

                              $inventoryModel = Vtiger_Inventory_Model::getInstance($this->module);

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

                           */

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

                                      [$entityName] = $this->transformInventoryReference($this->currentInventoryRawData['name'], true);

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

                                      if ($fieldObject) {

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

                              $entityId = $entityInfo['id'] ?? null;

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

                                          $comparisonValue = $fieldData[$mergeField];

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

                                                      $this->addRelation($row['relation_id'], $row['src_record'], Vtiger_Record_Model::getInstanceById($baseRecordId));

                      Line exceeds 120 characters; contains 121 characters
                      Open

                                                          // existing record data is priority - do not override - save only empty record fields

                      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

                                          $entityInfo = null;

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

                           * @return mixed

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

                              $maps = $inventoryModel->getAutoCompleteFields();

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

                                          } elseif (\array_key_exists($fieldName, $maps)) {

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

                                              $value = $this->transformInventoryFieldFromMap($value, $maps[$fieldName]);

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

                          public function transformInventoryFieldFromMap($value, $mapData)

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

                           * Function transforms value for reference type field.

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

                                                  // remove empty values - do not modify existing

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

                                                  });

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

                                                  break;

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

                                              $value = $this->transformInventoryReference($value);

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

                                                  if ($valueData) {

                      Line exceeds 120 characters; contains 146 characters
                      Open

                                                  $this->updateRecordByModel($baseRecordId, $fieldData, $moduleName, $row['relation_id'] ?? 0, $row['src_record'] ?? 0);

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

                                      $createRecord = true;

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

                                  if ($createRecord) {

                      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

                                  if (null === $entityInfo) {

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

                                              $currencyParam = $data['currencyparam'];

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

                           * Transform inventory field from map.

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

                                  if ($this->currentInventoryRawData['name']) {

                      Line exceeds 120 characters; contains 124 characters
                      Open

                                          $fieldObject = $moduleObject ? Vtiger_Field_Model::getInstance($mapData['field'], $moduleObject) : null;

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

                              $value = trim($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

                              foreach ($inventoryData as &$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

                                          $fieldObject = $moduleObject ? Vtiger_Field_Model::getInstance($mapData['field'], $moduleObject) : null;

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

                                      }

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

                                              if (\in_array($value, $picklist)) {

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

                                                  $value = array_search($value, $picklist);

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

                                                  $value = '';

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

                           *

                      Line exceeds 120 characters; contains 147 characters
                      Open

                                                      } elseif ('' === $fieldValue && isset($defaultFieldValues[$fieldName]) && '' !== $defaultFieldValues[$fieldName]) {

                      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

                                      } else {

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

                                              $data['currencyparam'] = \App\Json::encode($newCurrencyParam);

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

                           * @param $inventoryData

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

                          public function transformInventoryReference($value, $getArray = 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

                                              $picklist = $fieldObject->getValuesName();

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

                           * @param mixed               $getArray

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

                                          $fieldInstance = $inventoryFields[$fieldName];

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

                                          if (\in_array($fieldInstance->getType(), ['Name', 'Reference'])) {

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

                                              $currencyParam = $fieldInstance->getCurrencyParam([], $currencyParam);

                      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 134 characters
                      Open

                                      if ($this->inventoryFieldMapData[$mapData['field']] && $this->inventoryFieldMapData[$mapData['field']][$entityName]) {

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

                                          $this->inventoryFieldMapData[$mapData['field']][$entityName] = $fieldObject;

                      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 (strpos($value, '::::') > 0) {

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

                                                  $fieldData = $this->transformForImport($fieldData);

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

                                                  break;

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

                                          $fieldData['inventoryData'] = $inventoryFieldData;

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

                                          } elseif ('Currency' == $fieldInstance->getType()) {

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

                                              $value = \App\Fields\Currency::getCurrencyIdByName($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

                           * @return mixed

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

                                                      return '' !== $fieldValue;

                      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

                              $inventoryFields = $inventoryModel->getFields();

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

                           * @param $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

                                          $fieldObject = $this->inventoryFieldMapData[$mapData['field']][$entityName];

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

                              return $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

                                          $entityInfo = $this->createRecordByModel($moduleName, $fieldData, $row['relation_id'] ?? 0, $row['src_record'] ?? 0);

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

                                      $entityInfo = ['id' => null, 'status' => self::IMPORT_RECORD_FAILED];

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

                                  $this->currentInventoryRawData = $data;

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

                                  foreach ($data as $fieldName => &$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

                              $this->currentInventoryRawData = [];

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

                              return $inventoryData;

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

                          /**

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

                           *

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

                           * @return false|int|string

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

                                          $moduleObject = vtlib\Module::getInstance($entityName);

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

                                              $this->inventoryFieldMapData[$mapData['field']] = [];

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

                                  }

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

                           * @param \Vtiger_Field_Model $fieldInstance

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

                           * @param mixed               $value

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

                                                  $entityInfo['status'] = self::IMPORT_RECORD_MERGED;

                      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

                              $dataReader->close();

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

                                                  $valueData = \App\Fields\Currency::getCurrencyIdByName($key);

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

                                          if ('picklist' === $fieldObject->getFieldDataType()) {

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

                                          $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

                                                  $fieldData = array_filter($fieldData, function ($fieldValue) {

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

                                                  $this->updateRecordByModel($baseRecordId, $fieldData, $moduleName, $row['relation_id'] ?? 0, $row['src_record'] ?? 0);

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

                                                  $createRecord = true;

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

                                      if ($fieldData && $isInventory) {

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

                              }

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

                           * Transform inventory for import.

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

                          {

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

                                              $newCurrencyParam = [];

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

                                          }

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

                           * @param string              $fieldValue

                      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 (null === $fieldData) {

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

                                  $this->importedRecordInfo[$rowId] = $entityInfo;

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

                          public function transformInventoryForImport($inventoryData)

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

                                                      $newCurrencyParam[$valueData] = $currencyData;

                      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($value)) {

                      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

                                              } elseif (!\array_key_exists($value, $picklist)) {

                      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

                              if (!empty($value)) {

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

                                                          $fieldValue = $defaultFieldValues[$fieldName];

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

                                                  }

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

                                          $createRecord = true;

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

                                      $fieldData = $this->transformForImport($fieldData);

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

                                              foreach ($currencyParam as $key => $currencyData) {

                      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 $mapData

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

                                      }

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

                                      $fieldValueDetails = explode(':::', $value);

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

                           * @return array

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

                                          ++$statusCount['MERGED'];

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

                                          break;

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

                              return $statusCount;

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

                           */

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

                                      'imported' => $importStatusCount['IMPORTED'],

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

                                      'module' => App\Language::translate($importDataController->module, $importDataController->module),

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

                                      $record = \Vtiger_Record_Model::getCleanInstance($forModule);

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

                                  } elseif (strpos($value, ':::') > 0) {

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

                                      $value = \App\Record::getCrmIdByLabel($referenceModuleName, $entityLabel);

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

                          /**

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

                              $moduleModel = Vtiger_Module_Model::getInstance($this->module);

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

                          }

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

                              $dataReader->close();

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

                          public static function runScheduledImport()

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

                                      'skipped' => $importStatusCount['SKIPPED'],

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

                                  $importDataController->finishImport();

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

                              return $scheduledImports;

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

                                  $moduleModel = Vtiger_Module_Model::getInstance($forModule);

                      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

                              $tableName = Import_Module_Model::getDbTableName($this->user);

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

                                      'failed' => $importStatusCount['FAILED'],

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

                              }

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

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

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

                                      $entityLabel = trim($fieldValueDetails[1]);

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

                                  }

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

                           * @param array $fieldData

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

                                  ++$statusCount['TOTAL'];

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

                                  ++$statusCount['IMPORTED'];

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

                                          break;

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

                                      case self::IMPORT_RECORD_UPDATED:

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

                                          break;

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

                                  }

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

                                      'template' => 'ImportCron',

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

                              $importQueue = Import_Queue_Action::getAll(Import_Queue_Action::$IMPORT_STATUS_SCHEDULED);

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

                          }

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

                              $importRecords = [];

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

                                      if ($key > 2) {

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

                                          $importRecords['headers'][$fieldName] = $moduleModel->getFieldByName($fieldName)->getFieldLabel();

                      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 transformForImport($fieldData)

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

                                      case self::IMPORT_RECORD_MERGED:

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

                              $scheduledImports = self::getScheduledImport();

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

                                  $importDataController->batchImport = false;

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

                                  $scheduledImports[$importId] = new self($importInfo, \App\User::getUserModel($importInfo['user_id']));

                      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\User $user

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

                                      if (self::IMPORT_RECORD_SKIPPED === (int) $row['temp_status']) {

                      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

                                  $fieldData[$fieldName] = $fieldInstance->getUITypeModel()->getValueFromImport($fieldValue, $this->defaultValues[$fieldName] ?? null);

                      Line exceeds 120 characters; contains 145 characters
                      Open

                                  $fieldData[$fieldName] = $fieldInstance->getUITypeModel()->getValueFromImport($fieldValue, $this->defaultValues[$fieldName] ?? null);

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

                                          break;

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

                                      case self::IMPORT_RECORD_FAILED:

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

                                          break;

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

                                          break;

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

                              }

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

                          /**

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

                                  App\User::setCurrentUserId($importDataController->user->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

                              $query = new \App\Db\Query();

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

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

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

                              }

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

                              return $importRecords;

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

                              $query = (new \App\Db\Query())->select(['temp_status'])->from($tableName);

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

                                          --$statusCount['IMPORTED'];

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

                                  $importStatusCount = $importDataController->getImportStatusCount();

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

                              }

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

                           * @parms \App\User $user Current 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

                              $tableName = Import_Module_Model::getDbTableName($user);

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

                                  }

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

                          {

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

                                  'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];

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

                                          ++$statusCount['UPDATED'];

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

                                      'updated' => $importStatusCount['UPDATED'],

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

                           * @param mixed     $forModule

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

                              $statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,

                      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

                              foreach ($importQueue as $importId => $importInfo) {

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

                                  $fieldInstance = $moduleModel->getFieldByName($fieldName);

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

                              while (false !== ($status = $dataReader->readColumn(0))) {

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

                                  switch ($status) {

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

                                      case self::IMPORT_RECORD_CREATED:

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

                                  }

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

                                      'to' => [$importDataController->user->getDetail('email1') => $importDataController->user->getName()],

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

                                  $columnNames = $db->getTableSchema($tableName, true)->getColumnNames();

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

                                          $importRecords['skipped'][] = $record;

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

                              foreach ($fieldData as $fieldName => $fieldValue) {

                      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 ($scheduledImports as $importDataController) {

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

                                  $importDataController->importData();

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

                                      'created' => $importStatusCount['CREATED'],

                      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

                                      $fieldValueDetails = explode('::::', $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

                                  if (\is_array($fieldValueDetails) && \count($fieldValueDetails) > 1) {

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

                                      $referenceModuleName = trim($fieldValueDetails[0]);

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

                           * Get import status count.

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

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

                                      case self::IMPORT_RECORD_NONE:

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

                                          --$statusCount['IMPORTED'];

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

                          }

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

                              $scheduledImports = [];

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

                           *  Function to get Record details of import.

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

                           * @parms string $forModule Imported module

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

                                  foreach ($columnNames as $key => $fieldName) {

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

                                  $dataReader->close();

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

                              }

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

                           * Function parses data to import.

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

                                      case self::IMPORT_RECORD_SKIPPED:

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

                                  if (!$importDataController->initializeImport()) {

                      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 static function getScheduledImport()

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

                           * @returns array Import Records with the list of skipped records and failed records

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

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

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

                                      foreach ($importRecords['headers'] as $columnName => $header) {

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

                                          $record->set($columnName, $row[$columnName]);

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

                                          $importRecords['failed'][] = $record;

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

                              return $getArray ? [$referenceModuleName, $value] : $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

                           * @return int

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

                                          break;

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

                          }

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

                              $query->from($tableName)->where(['temp_status' => [self::IMPORT_RECORD_SKIPPED, self::IMPORT_RECORD_FAILED]]);

                      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

                                          ++$statusCount['FAILED'];

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

                                          ++$statusCount['SKIPPED'];

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

                                      'merged' => $importStatusCount['MERGED'],

                      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 $fieldData;

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

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

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

                                          ++$statusCount['PENDING'];

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

                                          ++$statusCount['CREATED'];

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

                                      default:

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

                           * Function run scheduled import and send email.

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

                          {

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

                                  \App\Mailer::sendFromTemplate([

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

                                      'total' => $importStatusCount['TOTAL'],

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

                          public static function getImportDetails(App\User $user, $forModule)

                      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 ($dataReader->count()) {

                      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

                              $temp_status = '';

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

                              return $temp_status;

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

                           *

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

                           * @param string   $moduleName

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

                              $ID = $recordModel->getId();

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

                           * Add relation.

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

                          public function addRelation(int $relationId, int $sourceId, Vtiger_Record_Model $recordModel)

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

                                  && $sourceRecord && $sourceRecord->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

                           * @param string $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

                                  case 'merged':

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

                                      $temp_status = self::IMPORT_RECORD_MERGED;

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

                                  $inventoryData = $fieldData['inventoryData'];

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

                              $relationModel = Vtiger_Relation_Model::getInstanceById($relationId);

                      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 updateRecordByModel($record, $fieldData, $moduleName = false, ?int $relationId = 0, ?int $sourceId = 0)

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

                           * @return int

                      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 = Vtiger_Record_Model::getCleanInstance($moduleName);

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

                              return null;

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

                           *

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

                           */

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

                              $sourceRecord = \App\Record::isExists($sourceId) ? Vtiger_Record_Model::getInstanceById($sourceId) : null;

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

                              if ($relationModel

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

                                  && $relationModel->getRelationModuleName() === $this->module

                      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

                                      break;

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

                              }

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

                          {

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

                          /**

                      Line exceeds 120 characters; contains 123 characters
                      Open

                          public function updateRecordByModel($record, $fieldData, $moduleName = false, ?int $relationId = 0, ?int $sourceId = 0)

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

                              foreach ($fieldData as $fieldName => &$value) {

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

                                  $recordModel->set($fieldName, $value);

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

                              $recordModel->save();

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

                           * Get import record status.

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

                           *

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

                          {

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

                                  case 'failed':

                      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->addRelation($relationId, $sourceId, $recordModel);

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

                                  case 'created':

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

                                  case 'skipped':

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

                                      $temp_status = self::IMPORT_RECORD_UPDATED;

                      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->initInventoryData($inventoryData, false);

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

                                  if ($relationId) {

                      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 ($relationId) {

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

                                      $temp_status = self::IMPORT_RECORD_CREATED;

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

                                  case 'updated':

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

                                      $temp_status = self::IMPORT_RECORD_FAILED;

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

                          public function createRecordByModel($moduleName, $fieldData, ?int $relationId = 0, ?int $sourceId = 0)

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

                                  $recordModel->set($fieldName, $value);

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

                           * @param int|null            $sourceId

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

                           * @param int|null $sourceId

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

                              $recordModel = Vtiger_Record_Model::getInstanceById($record, $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

                                      $temp_status = self::IMPORT_RECORD_SKIPPED;

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

                                      break;

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

                                  case 'none':

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

                           * @param array    $fieldData

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

                              if (!empty($inventoryData)) {

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

                           * @param int                 $relationId

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

                           * @param int      $record

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

                           * @param array    $fieldData

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

                           * @param string   $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

                              $recordModel->save();

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

                                  && $relationModel->getParentModuleModel()->getName() === $sourceRecord->getModuleName()

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

                           * @param int|null $relationId

                      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 getImportRecordStatus($value)

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

                                      break;

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

                                      break;

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

                                      $temp_status = self::IMPORT_RECORD_NONE;

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

                                      break;

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

                          }

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

                           * @return array|null

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

                              }

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

                              if (!empty($ID)) {

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

                                  $relationModel->addRelation($sourceRecord->getId(), $recordModel->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

                           * @param int|null $sourceId

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

                              if (isset($fieldData['inventoryData'])) {

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

                              }

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

                                  unset($fieldData['inventoryData']);

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

                          }

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

                           * Create 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

                                      break;

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

                                  default:

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

                                  return ['id' => $ID, 'status' => self::IMPORT_RECORD_CREATED];

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

                              }

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

                          }

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

                              if (isset($fieldData['inventoryData'])) {

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

                                  if ($fieldData['inventoryData']) {

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

                              switch ($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

                              foreach ($fieldData as $fieldName => &$value) {

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

                                      break;

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

                                  unset($fieldData['inventoryData']);

                      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 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

                           * Update record.

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

                                      $recordModel->initInventoryData($fieldData['inventoryData'], false);

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

                           * @param int|null $relationId

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

                                      $this->addRelation($relationId, $sourceId, $recordModel);

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

                              }

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

                      class Import_Data_Action extends \App\Controller\Action

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $ID is not named in camelCase.
                      Open

                          public function createRecordByModel($moduleName, $fieldData, ?int $relationId = 0, ?int $sourceId = 0)
                          {
                              $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
                              if (isset($fieldData['inventoryData'])) {
                                  $inventoryData = $fieldData['inventoryData'];
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $ID is not named in camelCase.
                      Open

                          public function createRecordByModel($moduleName, $fieldData, ?int $relationId = 0, ?int $sourceId = 0)
                          {
                              $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
                              if (isset($fieldData['inventoryData'])) {
                                  $inventoryData = $fieldData['inventoryData'];
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $temp_status is not named in camelCase.
                      Open

                          public function getImportRecordStatus($value)
                          {
                              $temp_status = '';
                              switch ($value) {
                                  case 'created':
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $ID is not named in camelCase.
                      Open

                          public function createRecordByModel($moduleName, $fieldData, ?int $relationId = 0, ?int $sourceId = 0)
                          {
                              $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
                              if (isset($fieldData['inventoryData'])) {
                                  $inventoryData = $fieldData['inventoryData'];
                      Severity: Minor
                      Found in modules/Import/actions/Data.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      There are no issues that match your filters.

                      Category
                      Status