YetiForceCompany/YetiForceCRM

View on GitHub
app/RecordConverter.php

Summary

Maintainability
F
5 days
Test Coverage
F
4%

Function initInventoryValuesByUser has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
Open

    private function initInventoryValuesByUser()
    {
        $invData = [];
        $counter = 1;
        foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
Severity: Minor
Found in app/RecordConverter.php - About 1 day 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 RecordConverter.php has 439 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * RecordConverter class.
 *
Severity: Minor
Found in app/RecordConverter.php - About 6 hrs to fix

    Function initInventoryValuesAuto has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        private function initInventoryValuesAuto()
        {
            $invData = [];
            $counter = 1;
            foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
    Severity: Minor
    Found in app/RecordConverter.php - About 6 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 checkIfDuplicateRecordExists has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        public function checkIfDuplicateRecordExists()
        {
            if ($this->get('check_duplicate') && isset($this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()])) {
                $referenceDestinyField = $this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()];
                if ($referenceDestinyField) {
    Severity: Minor
    Found in app/RecordConverter.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

    RecordConverter has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class RecordConverter extends Base
    {
        /** @var int Field to mapping */
        const FIELD_TO_MAPPING = 1;
    
    
    Severity: Minor
    Found in app/RecordConverter.php - About 3 hrs to fix

      The class RecordConverter has 12 public methods. Consider refactoring RecordConverter to keep number of public methods under 10.
      Open

      class RecordConverter extends Base
      {
          /** @var int Field to mapping */
          const FIELD_TO_MAPPING = 1;
      
      
      Severity: Minor
      Found in app/RecordConverter.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

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

      class RecordConverter extends Base
      {
          /** @var int Field to mapping */
          const FIELD_TO_MAPPING = 1;
      
      
      Severity: Minor
      Found in app/RecordConverter.php by phpmd

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

          public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
          {
              $converters = [];
              if (null === $userId) {
                  $userId = \App\User::getCurrentUserId();
      Severity: Minor
      Found in app/RecordConverter.php - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method initInventoryValuesByUser has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function initInventoryValuesByUser()
          {
              $invData = [];
              $counter = 1;
              foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
      Severity: Minor
      Found in app/RecordConverter.php - About 1 hr to fix

        The class RecordConverter has 17 fields. Consider redesigning RecordConverter to keep the number of fields under 15.
        Open

        class RecordConverter extends Base
        {
            /** @var int Field to mapping */
            const FIELD_TO_MAPPING = 1;
        
        
        Severity: Minor
        Found in app/RecordConverter.php by phpmd

        TooManyFields

        Since: 0.1

        Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

        Example

        class Person {
           protected $one;
           private $two;
           private $three;
           [... many more fields ...]
        }

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

        Method initInventoryValuesAuto has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function initInventoryValuesAuto()
            {
                $invData = [];
                $counter = 1;
                foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
        Severity: Minor
        Found in app/RecordConverter.php - About 1 hr to fix

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

              public function initFieldValuesAuto()
              {
                  foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
                      foreach ($this->sourceModuleModel->getFields() as $fieldModel) {
                          if ('picklist' === $fieldModel->getFieldDataType()) {
          Severity: Minor
          Found in app/RecordConverter.php - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public static function isAvailable(\Vtiger_Record_Model $recordModel, string $view = '', ?int $userId = null): bool
              {
                  $result = false;
                  if (null === $userId) {
                      $userId = \App\User::getCurrentUserId();
          Severity: Minor
          Found in app/RecordConverter.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 getModuleConverters has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
              {
                  $converters = [];
                  if (null === $userId) {
                      $userId = \App\User::getCurrentUserId();
          Severity: Minor
          Found in app/RecordConverter.php - About 1 hr to fix

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

                public function getRecordModelsWithoutMerge(array $records)
                {
                    foreach ($records as $recordId) {
                        if (!$this->isPermitted($recordId)) {
                            continue;
            Severity: Minor
            Found in app/RecordConverter.php - About 45 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

                public function checkFieldMergeExist()
                {
                    $this->isFieldMergeExists = false;
                    if (isset($this->fieldMapping['field_merge'])) {
                        $destinyReferenceFields = $this->destinyModuleModel->getFieldsByReference();
            Severity: Minor
            Found in app/RecordConverter.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 initFieldValuesByUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function initFieldValuesByUser()
                {
                    $fieldsData = $this->getMappingFields()[$this->destinyModuleModel->getId()] ?? [];
                    $destFieldList = $this->destinyModuleModel->getFieldsById();
                    foreach ($this->cleanRecordModels as $key => $cleanRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.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 checkFieldMappingFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function checkFieldMappingFields()
                {
                    if (isset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()])) {
                        foreach ($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
                            if (!$this->destinyModuleModel->getField($destinyField)) {
            Severity: Minor
            Found in app/RecordConverter.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

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

                public function getRecordsGroupBy(array $records)
                {
                    foreach ($this->getGroupRecords($records) as $groupBy => $recordsId) {
                        $this->cleanRecordModels[$groupBy] = \Vtiger_Record_Model::getCleanInstance($this->destinyModule);
                        $this->cleanRecordModels[$groupBy]->set($this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()], $groupBy);
            Severity: Minor
            Found in app/RecordConverter.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 initInventoryValuesByUser() has an NPath complexity of 271. The configured NPath complexity threshold is 200.
            Open

                private function initInventoryValuesByUser()
                {
                    $invData = [];
                    $counter = 1;
                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.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 getModuleConverters() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
            Open

                public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
                {
                    $converters = [];
                    if (null === $userId) {
                        $userId = \App\User::getCurrentUserId();
            Severity: Minor
            Found in app/RecordConverter.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 initInventoryValuesByUser() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
            Open

                private function initInventoryValuesByUser()
                {
                    $invData = [];
                    $counter = 1;
                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.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 initInventoryValuesAuto() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
            Open

                private function initInventoryValuesAuto()
                {
                    $invData = [];
                    $counter = 1;
                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.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 20 to the 15 allowed.
            Open

                public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
            Severity: Critical
            Found in app/RecordConverter.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 41 to the 15 allowed.
            Open

                private function initInventoryValuesAuto()
            Severity: Critical
            Found in app/RecordConverter.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 27 to the 15 allowed.
            Open

                public function checkIfDuplicateRecordExists()
            Severity: Critical
            Found in app/RecordConverter.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 68 to the 15 allowed.
            Open

                private function initInventoryValuesByUser()
            Severity: Critical
            Found in app/RecordConverter.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 "RecordConverter" has 29 methods, which is greater than 20 authorized. Split it into smaller classes.
            Open

            class RecordConverter extends Base
            Severity: Major
            Found in app/RecordConverter.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.

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

            class RecordConverter extends Base
            {
                /** @var int Field to mapping */
                const FIELD_TO_MAPPING = 1;
            
            
            Severity: Minor
            Found in app/RecordConverter.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

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

                public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
                {
                    $converters = [];
                    if (null === $userId) {
                        $userId = \App\User::getCurrentUserId();
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

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

                        && (\App\Json::isEmpty($this->get('conditions')) || \App\Condition::checkConditions(\App\Json::decode($this->get('conditions')), \Vtiger_Record_Model::getInstanceById($recordId)));
            Severity: Minor
            Found in app/RecordConverter.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 'getQuery'.
            Open

                        return Cache::get('getQueryRecordConverter', $moduleName . $view);
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

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

                        Log::error("Could not find record converter id: $id module name: $moduleName");
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\App\Privilege' in method 'isAvailable'.
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.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 'getModuleConverters'.
            Open

                        $conditions = $row['conditions'] ? \App\Json::decode($row['conditions']) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\App\Module' in method 'getModuleConverters'.
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.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 getInstanceById uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        Log::error("Could not find record converter id: $id module name: $moduleName");
                        throw new Exceptions\AppException('ERR_NOT_FOUND_RECORD_CONVERTER|' . $id);
                    }
            Severity: Minor
            Found in app/RecordConverter.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 assigning values to variables in if clauses and the like (line '200', column '11').
            Open

                public static function isAvailable(\Vtiger_Record_Model $recordModel, string $view = '', ?int $userId = null): bool
                {
                    $result = false;
                    if (null === $userId) {
                        $userId = \App\User::getCurrentUserId();
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

            Avoid using static access to class 'App\Module' in method 'isPermitted'.
            Open

                    $moduleName = Module::getModuleName($this->get('source_module'));
            Severity: Minor
            Found in app/RecordConverter.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 'getInstanceById'.
            Open

                    $row = $query->one(Db::getInstance('admin'));
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\App\Module' in method 'isAvailable'.
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.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 'getModuleConverters'.
            Open

                        $userId = \App\User::getCurrentUserId();
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\App\Privilege' in method 'isPermitted'.
            Open

                    return \App\Privilege::isPermitted($moduleName, 'RecordConventer') && \App\Privilege::isPermitted($moduleName, 'DetailView', $recordId)
            Severity: Minor
            Found in app/RecordConverter.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 'init'.
            Open

                    $this->fieldMapping = $this->get('field_mapping') ? Json::decode($this->get('field_mapping')) : [];
            Severity: Minor
            Found in app/RecordConverter.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 'init'.
            Open

                    $this->inventoryMapping = $this->get('inv_field_mapping') ? Json::decode($this->get('inv_field_mapping')) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\App\Privilege' in method 'isPermitted'.
            Open

                    return \App\Privilege::isPermitted($moduleName, 'RecordConventer') && \App\Privilege::isPermitted($moduleName, 'DetailView', $recordId)
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Module' in method 'getInstanceById'.
            Open

                        $query->andWhere(['source_module' => Module::getModuleId($moduleName)]);
            Severity: Minor
            Found in app/RecordConverter.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 'getQuery'.
            Open

                    Cache::save('getQueryRecordConverter', $moduleName . $view, $query);
            Severity: Minor
            Found in app/RecordConverter.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 'init'.
            Open

                    $this->sourceModuleModel = \Vtiger_Module_Model::getInstance($this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.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 'getRecordsGroupBy'.
            Open

                                $this->recordModels[$groupBy][$recordId] = \Vtiger_Record_Model::getInstanceById($recordId, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.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 'isActive'.
            Open

                    return self::getQuery($moduleName, $view)->exists(Db::getInstance('admin'));
            Severity: Minor
            Found in app/RecordConverter.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 'getModuleConverters'.
            Open

                                if (\App\Condition::checkConditions($conditions, \Vtiger_Record_Model::getInstanceById($recordId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Module' in method 'getDestinyModules'.
            Open

                        $destinyModuleName = Module::getModuleName($destinyModuleId);
            Severity: Minor
            Found in app/RecordConverter.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 'isPermitted'.
            Open

                        && (\App\Json::isEmpty($this->get('conditions')) || \App\Condition::checkConditions(\App\Json::decode($this->get('conditions')), \Vtiger_Record_Model::getInstanceById($recordId)));
            Severity: Minor
            Found in app/RecordConverter.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 process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                        } else {
                            $this->getRecordModelsWithoutMerge($records);
                        }
            Severity: Minor
            Found in app/RecordConverter.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_Module_Model' in method 'initDestinyModuleValues'.
            Open

                    $this->destinyModuleModel = \Vtiger_Module_Model::getInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.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 'isAvailable'.
            Open

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

                    if (Cache::has('getQueryRecordConverter', $moduleName . $view)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Module' in method 'init'.
            Open

                    $this->sourceModule = Module::getModuleName($this->get('source_module'));
            Severity: Minor
            Found in app/RecordConverter.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 'getRecordsGroupBy'.
            Open

                        $this->cleanRecordModels[$groupBy] = \Vtiger_Record_Model::getCleanInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.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\Condition' in method 'isAvailable'.
            Open

                        $result = $modulePermitted && \App\Condition::checkConditions($conditions, $recordModel);
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class '\App\Privilege' in method 'getModuleConverters'.
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.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\Condition' in method 'getModuleConverters'.
            Open

                                if (\App\Condition::checkConditions($conditions, \Vtiger_Record_Model::getInstanceById($recordId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Module' in method 'getQuery'.
            Open

                        $moduleName = Module::getModuleId($moduleName);
            Severity: Minor
            Found in app/RecordConverter.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\Condition' in method 'isPermitted'.
            Open

                        && (\App\Json::isEmpty($this->get('conditions')) || \App\Condition::checkConditions(\App\Json::decode($this->get('conditions')), \Vtiger_Record_Model::getInstanceById($recordId)));
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

            Avoid using static access to class 'App\Privilege' in method 'getDestinyModules'.
            Open

                        if (Privilege::isPermitted($destinyModuleName, 'CreateView')) {
            Severity: Minor
            Found in app/RecordConverter.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 'isAvailable'.
            Open

                        $userId = \App\User::getCurrentUserId();
            Severity: Minor
            Found in app/RecordConverter.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 'init'.
            Open

                    $this->defaultValuesCreatedRecord = $this->get('default_values') ? Json::decode($this->get('default_values')) : [];
            Severity: Minor
            Found in app/RecordConverter.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 'isPermitted'.
            Open

                        && (\App\Json::isEmpty($this->get('conditions')) || \App\Condition::checkConditions(\App\Json::decode($this->get('conditions')), \Vtiger_Record_Model::getInstanceById($recordId)));
            Severity: Minor
            Found in app/RecordConverter.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 '\CRMEntity' in method 'getGroupRecords'.
            Open

                    $focus = \CRMEntity::getInstance($this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.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 processInventoryMapping uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                        } else {
                            $this->initInventoryValuesByUser();
                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            ElseExpression

            Since: 1.4.0

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

            Example

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

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

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

                        $this->cleanRecordModels[$recordId] = \Vtiger_Record_Model::getCleanInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.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 checkIfDuplicateRecordExists uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                                    } else {
                                        $sourceRecordModel = \Vtiger_Record_Model::getInstanceById($groupBy, $this->sourceModule);
                                        $columnsToCheck[$referenceDestinyField] = $sourceRecordModel->get($this->get('field_merge'));
                                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            ElseExpression

            Since: 1.4.0

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

            Example

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

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

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

                            $this->recordModels[$recordId] = \Vtiger_Record_Model::getInstanceById($recordId, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

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

                                if (Fields\Picklist::isExists($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()))) {
            Severity: Minor
            Found in app/RecordConverter.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 '\CRMEntity' in method 'getQueryForDuplicate'.
            Open

                    $focus = \CRMEntity::getInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.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 checkIfDuplicateRecordExists uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                                } else {
                                    foreach ($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
                                        $columnsToCheck[$destinyField] = $this->textParserValues[$groupBy][$sourceField];
                                    }
                                }
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            ElseExpression

            Since: 1.4.0

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

            Example

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

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

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

                            } else {
                                $newRecordModel->set($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()));
                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            ElseExpression

            Since: 1.4.0

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

            Example

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

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

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

                                        } else {
                                            $inventoryFieldValue = $fieldModel->getDefaultValue();
                                        }
            Severity: Minor
            Found in app/RecordConverter.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 assigning values to variables in if clauses and the like (line '636', column '13').
            Open

                private function initInventoryValuesByUser()
                {
                    $invData = [];
                    $counter = 1;
                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

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

                    } else {
                        $this->initFieldValuesByUser();
                    }
            Severity: Minor
            Found in app/RecordConverter.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 assigning values to variables in if clauses and the like (line '533', column '59').
            Open

                public function initFieldValuesByUser()
                {
                    $fieldsData = $this->getMappingFields()[$this->destinyModuleModel->getId()] ?? [];
                    $destFieldList = $this->destinyModuleModel->getFieldsById();
                    foreach ($this->cleanRecordModels as $key => $cleanRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

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

                public function initFieldValuesByUser()
                {
                    $fieldsData = $this->getMappingFields()[$this->destinyModuleModel->getId()] ?? [];
                    $destFieldList = $this->destinyModuleModel->getFieldsById();
                    foreach ($this->cleanRecordModels as $key => $cleanRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

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

                        } else {
                            $sourceRecordModels = $this->recordModels[$groupBy];
                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            ElseExpression

            Since: 1.4.0

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

            Example

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

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

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

                        } else {
                            $sourceRecordModels = $this->recordModels[$groupBy];
                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            ElseExpression

            Since: 1.4.0

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

            Example

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

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

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

                                        $sourceRecordModel = \Vtiger_Record_Model::getInstanceById($groupBy, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            StaticAccess

            Since: 1.4.0

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

            Example

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

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

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

                private function initInventoryValuesByUser()
                {
                    $invData = [];
                    $counter = 1;
                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            IfStatementAssignment

            Since: 2.7.0

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

            Example

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

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

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

                    if (Cache::has('getQueryRecordConverter', $moduleName . $view)) {
            Severity: Critical
            Found in app/RecordConverter.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 "destiny_module" 3 times.
            Open

                        $destinyModules = array_filter(explode(',', $row['destiny_module']));
            Severity: Critical
            Found in app/RecordConverter.php by sonar-php

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

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

            Noncompliant Code Example

            With the default threshold of 3:

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

            Compliant Solution

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

            Exceptions

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

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

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

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Critical
            Found in app/RecordConverter.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_merge" 8 times.
            Open

                    $fieldModel = $this->sourceModuleModel->getField($this->get('field_merge'));
            Severity: Critical
            Found in app/RecordConverter.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 "mapping" 6 times.
            Open

                    $this->fieldMappingExecute = $this->fieldMapping && (isset($this->fieldMapping['auto']) || isset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()])) && (!$this->isFieldMergeExists || 1 === $recordsAmount);
            Severity: Critical
            Found in app/RecordConverter.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 "source_module" 4 times.
            Open

                        $query->andWhere(['source_module' => Module::getModuleId($moduleName)]);
            Severity: Critical
            Found in app/RecordConverter.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 '$recordModel'.
            Open

                            foreach ($this->cleanRecordModels as $groupBy => $recordModel) {
            Severity: Minor
            Found in app/RecordConverter.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

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

                        foreach ($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            UnusedLocalVariable

            Since: 0.2

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

            Example

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

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

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

                    while (!$result && ($row = $dataReader->read())) {
            Severity: Critical
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \App\RecordConverter->defaultValuesCreatedRecord
            Open

                    $this->defaultValuesCreatedRecord = $this->get('default_values') ? Json::decode($this->get('default_values')) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \App\RecordConverter->mapping
            Open

                            $this->mapping[$row['dest_module']][$row['dest_field']] = $row;
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Class \Vtiger_Record_Model was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties)
            Open

                        foreach ($sourceRecordModels as $recordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \CRMEntity->table_index
            Open

                    return (new Db\Query())->from($focus->table_name)->innerJoin($focus->customFieldTable[0], $focus->table_name . '.' . $focus->table_index . '=' . $focus->customFieldTable[0] . '.' . $focus->customFieldTable[1])
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \CRMEntity->table_name
            Open

                    return (new Db\Query())->from($focus->table_name)->innerJoin($focus->customFieldTable[0], $focus->table_name . '.' . $focus->table_index . '=' . $focus->customFieldTable[0] . '.' . $focus->customFieldTable[1])
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                    $dataReader->close();
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                    $query = (new Db\Query())->from('a_#__record_converter')->where(['source_module' => $moduleName, 'status' => 1]);
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                        $dataReader = (new Db\Query())->from('a_#__record_converter_mapping')->where(['id' => $this->getId()])->createCommand()->query();
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                        $userId = \App\User::getCurrentUserId();
            Severity: Critical
            Found in app/RecordConverter.php by phan

            Argument 1 (tabId) is string but \App\Module::getModuleName() takes int defined at /code/app/Module.php:129
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \App\RecordConverter->mapping
            Open

                    if (!isset($this->mapping)) {
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \CRMEntity->table_index
            Open

                        ->innerJoin('vtiger_crmentity', $focus->table_name . '.' . $focus->table_index . '= vtiger_crmentity.crmid');
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                    $query = (new Db\Query())->from('a_#__record_converter')->where(['id' => $id]);
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                    return self::getQuery($moduleName, $view)->exists(Db::getInstance('admin'));
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                    $dataReader->close();
            Severity: Critical
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \CRMEntity->customFieldTable
            Open

                    return (new Db\Query())->from($focus->table_name)->innerJoin($focus->customFieldTable[0], $focus->table_name . '.' . $focus->table_index . '=' . $focus->customFieldTable[0] . '.' . $focus->customFieldTable[1])
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Doc-block of getInstanceById contains declared return type \self which is incompatible with the return type \App\RecordConverter declared in the signature
            Open

                 * @return \self
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                        $userId = \App\User::getCurrentUserId();
            Severity: Critical
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \App\RecordConverter->mapping
            Open

                    return $this->mapping;
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Return type of processToEdit() is undeclared type \App\Vtiger_Module_Model
            Open

                public function processToEdit(int $record, string $destinyModule): \Vtiger_Record_Model
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \CRMEntity->table_name
            Open

                        ->innerJoin('vtiger_crmentity', $focus->table_name . '.' . $focus->table_index . '= vtiger_crmentity.crmid');
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Return type of getInstanceById() is undeclared type \self
            Open

                public static function getInstanceById(int $id, string $moduleName = ''): self
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Argument 1 (tabId) is string but \App\Module::getModuleName() takes int defined at /code/app/Module.php:129
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Argument 1 (tabId) is string but \App\Module::getModuleName() takes int defined at /code/app/Module.php:129
            Open

                        $destinyModuleName = Module::getModuleName($destinyModuleId);
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Assigning \Vtiger_Record_Model[][] to property but \App\RecordConverter->recordModels is \Vtiger_Record_Model[]
            Open

                                $this->recordModels[$groupBy][$recordId] = \Vtiger_Record_Model::getInstanceById($recordId, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phan

            Class \Vtiger_Record_Model was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties)
            Open

                        foreach ($sourceRecordModels as $recordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                                if (Fields\Picklist::isExists($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()))) {
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                                    $newRecordModel->set($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()));
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                    return (new Db\Query())->from($focus->table_name)->innerJoin($focus->customFieldTable[0], $focus->table_name . '.' . $focus->table_index . '=' . $focus->customFieldTable[0] . '.' . $focus->customFieldTable[1])
            Severity: Critical
            Found in app/RecordConverter.php by phan

            Doc-block of processToEdit contains declared return type \App\Vtiger_Module_Model which is incompatible with the return type \Vtiger_Record_Model declared in the signature
            Open

                 * @return Vtiger_Module_Model
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                    return (new Db\Query())->select([$fieldModel->getTableName() . ".{$fieldModel->getColumnName()}", $focus->tab_name_index[$fieldModel->getTableName()]])->from($fieldModel->getTableName())->where([$focus->tab_name_index[$fieldModel->getTableName()] => $records])->createCommand()->queryAllByGroup(2);
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                        Log::error("Could not find record converter id: $id module name: $moduleName");
            Severity: Critical
            Found in app/RecordConverter.php by phan

            Reference to undeclared property \App\RecordConverter->mapping
            Open

                        $this->mapping = [];
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                                $newRecordModel->set($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()));
            Severity: Minor
            Found in app/RecordConverter.php by phan

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

                                if ($query->where($columnsToCheck)->exists()) {
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                    while ($row = $dataReader->read()) {
            Severity: Critical
            Found in app/RecordConverter.php by phan

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

                public $inventoryMappingExecute = false;
            Severity: Minor
            Found in app/RecordConverter.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 $referenceDestinyField. Keep variable name length under 20.
            Open

                        $referenceDestinyField = $this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()];
            Severity: Minor
            Found in app/RecordConverter.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 $destinyReferenceFields. Keep variable name length under 20.
            Open

                        $destinyReferenceFields = $this->destinyModuleModel->getFieldsByReference();
            Severity: Minor
            Found in app/RecordConverter.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 $referenceDestinyField. Keep variable name length under 20.
            Open

                        $referenceDestinyField = $this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()];
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            LongVariable

            Since: 0.2

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

            Example

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

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

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

                public static function getInstanceById(int $id, string $moduleName = ''): self
            Severity: Minor
            Found in app/RecordConverter.php by phpmd

            ShortVariable

            Since: 0.2

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

            Example

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

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

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

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

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

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

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

                public $fieldMappingExecute = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var bool
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function to get the instance of the record converter model.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                public $sourceModuleModel;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var \Vtiger_Module_Model
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public $recordModels = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var array|string
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var int[]
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public $createdRecords = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public $groupRecordConvert = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public $destinyModule = '';
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                 * @var \Vtiger_Record_Model[]
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public $inventoryMapping;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Variable determines the possibility of inventory fields mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public $sourceModule = '';
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                const FIELD_TO_MAPPING = 1;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public $sourceInvFields = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Variable determines the possibility of fields mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                 * Contains values from text parser.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                 * Source module inventory fields.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var bool
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                public $isFieldMergeExists = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $query = (new Db\Query())->from('a_#__record_converter')->where(['id' => $id]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                /** @var int Field to mapping */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var \Vtiger_Module_Model
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var string
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @var \Vtiger_Record_Model[]
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * @var bool
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public static function getInstanceById(int $id, string $moduleName = ''): self
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        $self->setData($row);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                        $query->andWhere(['source_module' => Module::getModuleId($moduleName)]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * Destiny module name.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Destiny module model.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                 * @param int    $id
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @return \self
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Source module name.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public $fieldMapping;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                 * Source record models.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public $textParserValues = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                public $destinyInvFields = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public $inventoryMappingExecute = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Variable determines the type of group records.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $self = new self();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Source module model.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * Destiny module inventory fields.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * @var string
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public $destinyModuleModel;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Record models of created records.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public $cleanRecordModels = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * Created records ids.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                 * Convert field mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public $error = '';
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Variable determines if merge field exist.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $row = $query->one(Db::getInstance('admin'));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * Convert inventory mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var array|string
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @var bool
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @var string
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                            foreach ($recordIds as $recordId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    if (\is_string($moduleName)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * Gets ID.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    $this->fieldMapping = $this->get('field_mapping') ? Json::decode($this->get('field_mapping')) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    if ($this->sourceModuleModel->isInventory()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                public static function isActive($moduleName, string $view = ''): bool
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @param int|null $userId
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    Cache::save('getQueryRecordConverter', $moduleName . $view, $query);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        Log::error("Could not find record converter id: $id module name: $moduleName");
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    $result = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    if (null === $userId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $userId = \App\User::getCurrentUserId();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * Function gets module converters.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @return Db\Query
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @return int
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public function init()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->defaultValuesCreatedRecord = $this->get('default_values') ? Json::decode($this->get('default_values')) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    $dataReader->close();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @param string   $view
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    return $converters;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public static function getQuery($moduleName, string $view = ''): Db\Query
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $query->andWhere(['show_in_' . \strtolower($view) => 1]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    return $query;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    return $this->get('id');
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                break;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        $result = $modulePermitted && \App\Condition::checkConditions($conditions, $recordModel);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    return $result;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        if ($modulePermitted && $conditions && $recordIds) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                if (\App\Condition::checkConditions($conditions, \Vtiger_Record_Model::getInstanceById($recordId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                    break;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            $converters[$row['id']] = $row;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                 * Function variable initializing.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->sourceModuleModel = \Vtiger_Module_Model::getInstance($this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @param int $recordId
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public function isPermitted(int $recordId): bool
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        foreach ($destinyModules as $destinyModuleId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 136 characters
            Open

                public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @param string     $view
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Check permissions.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                 * Function check if convert for record and view is available.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @param string               $view
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                 * @param array    $recordIds
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        foreach ($destinyModules as $destinyModuleId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                break;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        } elseif ($modulePermitted) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                        $moduleName = Module::getModuleId($moduleName);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->sourceInvFields = \Vtiger_Inventory_Model::getInstance($this->sourceModule)->getFields();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                        throw new Exceptions\AppException('ERR_NOT_FOUND_RECORD_CONVERTER|' . $id);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $dataReader = self::getQuery($moduleName, $view)->createCommand()->query();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $modulePermitted = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    $dataReader = self::getQuery($recordModel->getModuleName(), $view)->createCommand()->query();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $modulePermitted = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        $destinyModules = array_filter(explode(',', $row['destiny_module']));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                 * @param \Vtiger_Record_Model $recordModel
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 148 characters
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    $dataReader->close();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $query = (new Db\Query())->from('a_#__record_converter')->where(['source_module' => $moduleName, 'status' => 1]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        $conditions = $row['conditions'] ? \App\Json::decode($row['conditions']) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                                    $converters[$row['id']] = $row;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @throws Exceptions\AppException
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->getMappingFields();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @param string     $view
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public static function isAvailable(\Vtiger_Record_Model $recordModel, string $view = '', ?int $userId = null): bool
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

            Line exceeds 120 characters; contains 148 characters
            Open

                            if (!($modulePermitted = \App\Privilege::isPermitted(\App\Module::getModuleName($destinyModuleId), 'CreateView', false, $userId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    if (Cache::has('getQueryRecordConverter', $moduleName . $view)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        return Cache::get('getQueryRecordConverter', $moduleName . $view);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->sourceModule = Module::getModuleName($this->get('source_module'));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->inventoryMapping = $this->get('inv_field_mapping') ? Json::decode($this->get('inv_field_mapping')) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    return $self;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function check if convert for module and view exist.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function return query about module converters in view.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        $userId = \App\User::getCurrentUserId();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $conditions = $row['conditions'] ? \App\Json::decode($row['conditions']) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 121 characters
            Open

                                if (\App\Condition::checkConditions($conditions, \Vtiger_Record_Model::getInstanceById($recordId))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                public function getId()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    return self::getQuery($moduleName, $view)->exists(Db::getInstance('admin'));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @param int|null             $userId
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $destinyModules = array_filter(explode(',', $row['destiny_module']));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    if (null === $userId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

            Line exceeds 120 characters; contains 121 characters
            Open

                    $query = (new Db\Query())->from('a_#__record_converter')->where(['source_module' => $moduleName, 'status' => 1]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 123 characters
            Open

                    $this->defaultValuesCreatedRecord = $this->get('default_values') ? Json::decode($this->get('default_values')) : [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @param array $records
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                        $dataReader = (new Db\Query())->from('a_#__record_converter_mapping')->where(['id' => $this->getId()])->createCommand()->query();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @throws Exceptions\AppException
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->setFieldsMapCanExecute($recordsAmount);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                public function initDestinyModuleValues(string $moduleName)
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->destinyModule = $moduleName;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @return Vtiger_Module_Model
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @param int[] $records
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $focus = \CRMEntity::getInstance($this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        foreach ($recordsId as $recordId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $moduleName = Module::getModuleName($this->get('source_module'));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            $this->groupRecordConvert = true;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Gets destiny modules.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                        $this->destinyInvFields = \Vtiger_Inventory_Model::getInstance($this->destinyModule)->getFields();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * Main function of class.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    foreach ($this->getDestinyModules() as $destinyModuleName) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->setInvMapCanExecute();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @param int $recordsAmount
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->fieldMappingExecute = $this->fieldMapping && (isset($this->fieldMapping['auto']) || isset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()])) && (!$this->isFieldMergeExists || 1 === $recordsAmount);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 230 characters
            Open

                    $this->fieldMappingExecute = $this->fieldMapping && (isset($this->fieldMapping['auto']) || isset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()])) && (!$this->isFieldMergeExists || 1 === $recordsAmount);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @param string $destinyModule
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public function getRecordsGroupBy(array $records)
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->cleanRecordModels[$groupBy] = \Vtiger_Record_Model::getCleanInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->processInventoryMapping();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            $this->getRecordsGroupBy($records);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            $this->getRecordModelsWithoutMerge($records);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    $this->initDestinyModuleValues($destinyModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->setInvMapCanExecute();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $fieldModel = $this->sourceModuleModel->getField($this->get('field_merge'));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

            Line exceeds 120 characters; contains 141 characters
            Open

                        $dataReader = (new Db\Query())->from('a_#__record_converter_mapping')->where(['id' => $this->getId()])->createCommand()->query();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $recordsAmount = \count($records);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        if ($this->isFieldMergeExists) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function to edit process.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * @throws Exceptions\AppException
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->getRecordModelsWithoutMerge([$record]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public function getGroupRecords(array $records): array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                        $this->checkIfDuplicateRecordExists();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                                $cleanRecordModel->set($fieldModel->getName(), $this->recordModels[$key]->get($sourceFieldModel->getName()));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 129 characters
            Open

                                $cleanRecordModel->set($fieldModel->getName(), $this->recordModels[$key]->get($sourceFieldModel->getName()));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                public function getMappingFields(): array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->mapping = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                 * Function initializing destiny module values.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->destinyModuleModel = \Vtiger_Module_Model::getInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    foreach ($this->getGroupRecords($records) as $groupBy => $recordsId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                        $this->initDestinyModuleValues($destinyModuleName);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * Function check if field mapping process can be proced.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function check if inventory mapping process can be proced.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    if ($this->destinyModuleModel->isInventory()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public function processToEdit(int $record, string $destinyModule): \Vtiger_Record_Model
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 306 characters
            Open

                    return (new Db\Query())->select([$fieldModel->getTableName() . ".{$fieldModel->getColumnName()}", $focus->tab_name_index[$fieldModel->getTableName()]])->from($fieldModel->getTableName())->where([$focus->tab_name_index[$fieldModel->getTableName()] => $records])->createCommand()->queryAllByGroup(2);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

            Line exceeds 120 characters; contains 192 characters
            Open

                        && (\App\Json::isEmpty($this->get('conditions')) || \App\Condition::checkConditions(\App\Json::decode($this->get('conditions')), \Vtiger_Record_Model::getInstanceById($recordId)));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                        $destinyModuleName = Module::getModuleName($destinyModuleId);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

            Line exceeds 120 characters; contains 152 characters
            Open

                    $this->inventoryMappingExecute = $this->inventoryMapping && $this->sourceModuleModel->isInventory() && $this->destinyModuleModel->isInventory();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                    return \current($this->cleanRecordModels);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function get query to group records.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->cleanRecordModels[$groupBy]->set($this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()], $groupBy);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    return $modules;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

            Line exceeds 120 characters; contains 134 characters
            Open

                        $this->cleanRecordModels[$groupBy]->set($this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()], $groupBy);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 143 characters
            Open

                    return \App\Privilege::isPermitted($moduleName, 'RecordConventer') && \App\Privilege::isPermitted($moduleName, 'DetailView', $recordId)
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->checkFieldMergeExist();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public function setFieldsMapCanExecute(int $recordsAmount)
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    return (new Db\Query())->select([$fieldModel->getTableName() . ".{$fieldModel->getColumnName()}", $focus->tab_name_index[$fieldModel->getTableName()]])->from($fieldModel->getTableName())->where([$focus->tab_name_index[$fieldModel->getTableName()] => $records])->createCommand()->queryAllByGroup(2);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->checkIfDuplicateRecordExists();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * Function set values to new record automatically.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

                            foreach ($recordModel as $recordModelGroupBy) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                foreach ($recordModelGroupBy->getInventoryData() as $inventoryRow) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                            $this->mapping[$row['dest_module']][$row['dest_field']] = $row;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->init();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    foreach (explode(',', $this->get('destiny_module')) as $destinyModuleId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        if (Privilege::isPermitted($destinyModuleName, 'CreateView')) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            $modules[$destinyModuleId] = $destinyModuleName;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->inventoryMappingExecute = $this->inventoryMapping && $this->sourceModuleModel->isInventory() && $this->destinyModuleModel->isInventory();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                $this->recordModels[$groupBy][$recordId] = \Vtiger_Record_Model::getInstanceById($recordId, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 133 characters
            Open

                                $this->recordModels[$groupBy][$recordId] = \Vtiger_Record_Model::getInstanceById($recordId, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    if (!isset($this->mapping)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                    if ($this->fieldMapping && (isset($this->fieldMapping['auto']) || isset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()])) && $this->isFieldMergeExists) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                            if (!isset($this->recordModels[$groupBy][$recordId])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                    return $this->mapping;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                 * @param int    $record
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->init();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    $this->checkFieldMergeExist();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 180 characters
            Open

                    if ($this->fieldMapping && (isset($this->fieldMapping['auto']) || isset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()])) && $this->isFieldMergeExists) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * @param array $records
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                if (Fields\Picklist::isExists($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                public function processInventoryMapping()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                    ++$counter;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                    return \App\Privilege::isPermitted($moduleName, 'RecordConventer') && \App\Privilege::isPermitted($moduleName, 'DetailView', $recordId)
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Gets fields form mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                public function process(array $records)
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

                public function setInvMapCanExecute()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $this->fieldMappingExecute = true;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function prepare records model group by field merge.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public function initFieldValuesByUser()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        $sourceFieldList = $this->recordModels[$key]->getModule()->getFieldsById();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            if (!\is_array($recordModel)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                                        $fieldCustomColumn = $fieldModel->getCustomColumn();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        && (\App\Json::isEmpty($this->get('conditions')) || \App\Condition::checkConditions(\App\Json::decode($this->get('conditions')), \Vtiger_Record_Model::getInstanceById($recordId)));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                 * @return string[]
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                public function getDestinyModules(): array
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Line exceeds 120 characters; contains 135 characters
            Open

                                $newRecordModel->set($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

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

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

                 * Function set values to new record defined by user.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                            if (self::FIELD_TO_MAPPING === $fieldRow['state'] && ($fieldModel = $destFieldList[$destFieldId])->isEditable() && ($sourceFieldModel = $sourceFieldList[$fieldRow['source_field']])->isActiveField()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                 * Function save changes in new record models.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

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

                        } catch (\Throwable $ex) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    foreach ($this->destinyInvFields as $columnName => $fieldModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        $invData[$groupBy][$counter][$columnName] = $inventoryFieldValue;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function prepare records model.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @param array $records
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach ($this->sourceModuleModel->getFields() as $fieldModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if ($this->inventoryMappingExecute && $this->inventoryMapping) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->initInventoryValuesAuto();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->initInventoryValuesByUser();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function prepare auto inventory mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $counter = 1;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (!\is_array($this->recordModels[$groupBy])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $sourceRecordModels = [$this->recordModels[$groupBy]];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->set('sourceRecord', $this->recordModels[$key]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 146 characters
            Open

                                if (Fields\Picklist::isExists($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()))) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $recordModel = [$recordModel];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        if (isset($this->sourceInvFields[$columnName])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getRecordModelsWithoutMerge(array $records)
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->processInventoryMapping();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function prepare mapping fields.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (isset($this->inventoryMapping[0]) && 'auto' === $this->inventoryMapping[0]) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    $newRecordModel->set($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $eventHandler->setParams(['converter' => $this]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $eventHandler->trigger(EventHandler::RECORD_CONVERTER_AFTER_SAVE);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $invData = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            $inventoryFieldValue = $inventoryRow[$columnName];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function initFieldValuesAuto()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($this->cleanRecordModels as $key => $cleanRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->createdRecords[] = $recordModel->getId();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach ($sourceRecordModels as $recordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $destFieldList = $this->destinyModuleModel->getFieldsById();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 216 characters
            Open

                            if (self::FIELD_TO_MAPPING === $fieldRow['state'] && ($fieldModel = $destFieldList[$destFieldId])->isEditable() && ($sourceFieldModel = $sourceFieldList[$fieldRow['source_field']])->isActiveField()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            unset($this->cleanRecordModels[$key]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function prepare inventory mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private function initInventoryValuesAuto()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                                $invData[$groupBy][$counter][$customColumn] = $inventoryRow[$customColumn] ?? [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function saveChanges()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($this->cleanRecordModels as $key => $recordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (isset($this->inventoryMapping[0]) && 'auto' === $this->inventoryMapping[0]) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $sourceRecordModels = $this->recordModels[$groupBy];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->saveChanges();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if ('picklist' === $fieldModel->getFieldDataType()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach ($fieldsData as $destFieldId => $fieldRow) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        try {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        if ($fieldCustomColumn) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (!$this->isPermitted($recordId)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->recordModels[$recordId] = \Vtiger_Record_Model::getInstanceById($recordId, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->saveChanges();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->initFieldValuesByUser();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $eventHandler = $recordModel->getEventHandler();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->error = $ex->getMessage();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            $inventoryFieldValue = $fieldModel->getDefaultValue();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            continue;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function processFieldMapping()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->initFieldValuesAuto();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 139 characters
            Open

                                    $newRecordModel->set($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $newRecordModel->set($fieldModel->getFieldName(), $this->recordModels[$groupBy]->get($fieldModel->getFieldName()));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $fieldsData = $this->getMappingFields()[$this->destinyModuleModel->getId()] ?? [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $newRecordModel->initInventoryDataFromRequest(new Request(['inventory' => $invData[$groupBy]], false));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($records as $recordId) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->cleanRecordModels[$recordId] = \Vtiger_Record_Model::getCleanInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (!isset($this->recordModels[$recordId])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->processFieldMapping();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $this->checkFieldMappingFields();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (!$this->get('redirect_to_edit')) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $recordModel->save();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            foreach (array_keys($fieldCustomColumn) as $customColumn) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 132 characters
            Open

                                        foreach ($this->inventoryMapping[$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    ++$counter;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function check if merge can be execute.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 208 characters
            Open

                            if (!$this->destinyModuleModel->getField($referenceDestinyField) || !$this->sourceModuleModel->getField($this->get('field_merge')) || !isset($destinyReferenceFields[$referenceDestinyField])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $this->isFieldMergeExists = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $focus = \CRMEntity::getInstance($this->destinyModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            $invData[$groupBy][$counter][$destinyField] = $inventoryRow[$sourceField];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function checkFieldMergeExist()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 121 characters
            Open

                        ->innerJoin('vtiger_crmentity', $focus->table_name . '.' . $focus->table_index . '= vtiger_crmentity.crmid');
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if ($this->get('check_duplicate') && isset($this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function prepare user inventory mapping.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                private function initInventoryValuesByUser()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            foreach ($recordModel as $recordModelGroupBy) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        foreach ($this->inventoryMapping[$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 121 characters
            Open

                                                    $invData[$groupBy][$counter][$customColumn] = $inventoryRow[$customColumn] ?? [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        if (!isset($invData[$groupBy][$counter][$columnName]) && $fieldModel->has('defaultValue')) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    $invData[$groupBy][$counter]['id'] = $inventoryRow['id'];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach ($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 123 characters
            Open

                        foreach ($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        ->innerJoin('vtiger_crmentity', $focus->table_name . '.' . $focus->table_index . '= vtiger_crmentity.crmid');
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $referenceDestinyField = $this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        $columnsToCheck[$destinyField] = $this->textParserValues[$groupBy][$sourceField];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function checkFieldMappingFields()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $destinyReferenceFields = $this->destinyModuleModel->getFieldsByReference();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function getQueryForDuplicate()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 121 characters
            Open

                                        $columnsToCheck[$referenceDestinyField] = $sourceRecordModel->get($this->get('field_merge'));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $recordModel = [$recordModel];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            if ($fieldCustomColumn = $this->destinyInvFields[$destinyField]->getCustomColumn()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    foreach ($this->destinyInvFields as $columnName => $fieldModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                unset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()][$destinyField]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $this->isFieldMergeExists = false;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    if ($this->groupRecordConvert) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (isset($this->fieldMapping['field_merge'])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (!$this->destinyModuleModel->getField($referenceDestinyField) || !$this->sourceModuleModel->getField($this->get('field_merge')) || !isset($destinyReferenceFields[$referenceDestinyField])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    return (new Db\Query())->from($focus->table_name)->innerJoin($focus->customFieldTable[0], $focus->table_name . '.' . $focus->table_index . '=' . $focus->customFieldTable[0] . '.' . $focus->customFieldTable[1])
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 217 characters
            Open

                    return (new Db\Query())->from($focus->table_name)->innerJoin($focus->customFieldTable[0], $focus->table_name . '.' . $focus->table_index . '=' . $focus->customFieldTable[0] . '.' . $focus->customFieldTable[1])
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 135 characters
            Open

                                    foreach ($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    unset($this->cleanRecordModels[$groupBy]);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                                    $invData[$groupBy][$counter][$customColumn] = $inventoryRow[$customColumn] ?? [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                                $invData[$groupBy][$counter][$customColumn] = '';
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                /**
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        $sourceRecordModel = \Vtiger_Record_Model::getInstanceById($groupBy, $this->sourceModule);
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $counter = 1;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    if (isset($this->inventoryMapping[$this->destinyModuleModel->getId()])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        if ($fieldCustomColumn = $fieldModel->getCustomColumn()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function check mapped fields.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    if (isset($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (!$this->destinyModuleModel->getField($destinyField)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            foreach ($this->cleanRecordModels as $groupBy => $recordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 *
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Line exceeds 120 characters; contains 125 characters
            Open

                    if ($this->get('check_duplicate') && isset($this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if ($referenceDestinyField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                if ($query->where($columnsToCheck)->exists()) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $sourceRecordModels = [$this->recordModels[$groupBy]];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $sourceRecordModels = $this->recordModels[$groupBy];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        $referenceDestinyField = $this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            $this->isFieldMergeExists = true;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        $columnsToCheck[$referenceDestinyField] = $groupBy;
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        $columnsToCheck[$referenceDestinyField] = $sourceRecordModel->get($this->get('field_merge'));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function check if exist duplicate of records.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                if ($this->isFieldMergeExists) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if (!\is_array($this->recordModels[$groupBy])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                foreach ($recordModelGroupBy->getInventoryData() as $inventoryRow) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                                foreach (array_keys($fieldCustomColumn) as $customColumn) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            $invData[$groupBy][$counter][$columnName] = $fieldModel->getDefaultValue();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            $invData[$groupBy][$counter][$columnName] = $inventoryRow[$columnName];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * @return Db\Query
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        } else {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            foreach (array_keys($fieldCustomColumn) as $customColumn) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                public function checkIfDuplicateRecordExists()
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $columnsToCheck = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                    foreach ($this->fieldMapping['mapping'][$this->destinyModuleModel->getId()] as $destinyField => $sourceField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            if (!\is_array($recordModel)) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $newRecordModel->initInventoryDataFromRequest(new Request(['inventory' => $invData[$groupBy]], false));
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 */
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                            }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    $invData = [];
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        foreach ($sourceRecordModels as $recordModel) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                        } elseif (!isset($invData[$groupBy][$counter][$columnName])) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                    }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                        if ($referenceDestinyField) {
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                }
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                 * Function get query for searching duplicates.
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            Spaces must be used to indent lines; tabs are not allowed
            Open

                                $query = $this->getQueryForDuplicate();
            Severity: Minor
            Found in app/RecordConverter.php by phpcodesniffer

            There are no issues that match your filters.

            Category
            Status