YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/LayoutEditor/models/Module.php

Summary

Maintainability
F
1 wk
Test Coverage
F
55%

File Module.php has 720 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Method getTypeDetailsForAddField has 214 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getTypeDetailsForAddField($fieldType, $params)
        {
            $displayType = 1;
            $importerType = new \App\Db\Importers\Base();
            switch ($fieldType) {
    Severity: Major
    Found in modules/Settings/LayoutEditor/models/Module.php - About 1 day to fix

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

          public function getTypeDetailsForAddField($fieldType, $params)
          {
              $displayType = 1;
              $importerType = new \App\Db\Importers\Base();
              switch ($fieldType) {
      Severity: Minor
      Found in modules/Settings/LayoutEditor/models/Module.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 validate has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          public function validate(array $data, bool $throw = true)
          {
              $message = null;
              $code = null;
              $result = false;
      Severity: Minor
      Found in modules/Settings/LayoutEditor/models/Module.php - About 4 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Settings_LayoutEditor_Module_Model has 33 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
      {
          /** {@inheritdoc} */
          public $name = 'LayoutEditor';
          /** @var string Parent name */
      Severity: Minor
      Found in modules/Settings/LayoutEditor/models/Module.php - About 4 hrs to fix

        Method addField has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function addField($fieldType, $blockId, $params)
            {
                $label = $params['fieldLabel'];
                $name = strtolower($params['fieldName']);
                $pickListValues = [];
        Severity: Major
        Found in modules/Settings/LayoutEditor/models/Module.php - About 4 hrs to fix

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

          class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
          {
              /** {@inheritdoc} */
              public $name = 'LayoutEditor';
              /** @var string Parent name */

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

              public function addField($fieldType, $blockId, $params)
              {
                  $label = $params['fieldLabel'];
                  $name = strtolower($params['fieldName']);
                  $pickListValues = [];
          Severity: Minor
          Found in modules/Settings/LayoutEditor/models/Module.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

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

              public function getMissingSystemFields(): array
              {
                  $fields = $this->getFields();
                  $systemFields = \App\Field::SYSTEM_FIELDS;
                  $missingFields = [];
          Severity: Minor
          Found in modules/Settings/LayoutEditor/models/Module.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

          Function getAddFieldTypeInfo has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getAddFieldTypeInfo()
              {
                  $fieldTypesInfo = [];
                  $addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
                  $lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
          Severity: Minor
          Found in modules/Settings/LayoutEditor/models/Module.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 validate has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function validate(array $data, bool $throw = true)
              {
                  $message = null;
                  $code = null;
                  $result = false;
          Severity: Major
          Found in modules/Settings/LayoutEditor/models/Module.php - About 2 hrs to fix

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

                public function getMissingSystemFields(): array
                {
                    $fields = $this->getFields();
                    $systemFields = \App\Field::SYSTEM_FIELDS;
                    $missingFields = [];
            Severity: Minor
            Found in modules/Settings/LayoutEditor/models/Module.php - About 1 hr to fix

              Method getAddFieldTypeInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getAddFieldTypeInfo()
                  {
                      $fieldTypesInfo = [];
                      $addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
                      $lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
              Severity: Minor
              Found in modules/Settings/LayoutEditor/models/Module.php - About 1 hr to fix

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

                    public function getTableName($type)
                    {
                        if (\is_int($type)) {
                            $focus = CRMEntity::getInstance($this->getSourceModule()->getName());
                            if (0 == $type) {
                Severity: Minor
                Found in modules/Settings/LayoutEditor/models/Module.php - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    public function addSystemField(string $sysName, int $blockId, array $params = []): void
                    {
                        $missingSystemFields = $this->getMissingSystemFields();
                        if (empty($missingSystemFields[$sysName])) {
                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
                Severity: Minor
                Found in modules/Settings/LayoutEditor/models/Module.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 isFieldsSortableAllowed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function isFieldsSortableAllowed($blockName)
                    {
                        $moduleName = $this->getSourceModule()->getName();
                        $blocksEliminatedArray = ['HelpDesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],
                            'Faq' => ['LBL_COMMENT_INFORMATION'],
                Severity: Minor
                Found in modules/Settings/LayoutEditor/models/Module.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 getBlocks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getBlocks()
                    {
                        if (empty($this->blocks)) {
                            $blocksList = [];
                            $moduleBlocks = Settings_LayoutEditor_Block_Model::getAllForModule($this->sourceModule);
                Severity: Minor
                Found in modules/Settings/LayoutEditor/models/Module.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 getTypeDetailsForAddField() has 219 lines of code. Current threshold is set to 100. Avoid really long methods.
                Open

                    public function getTypeDetailsForAddField($fieldType, $params)
                    {
                        $displayType = 1;
                        $importerType = new \App\Db\Importers\Base();
                        switch ($fieldType) {

                The method getAddFieldTypeInfo() has an NPath complexity of 201. The configured NPath complexity threshold is 200.
                Open

                    public function getAddFieldTypeInfo()
                    {
                        $fieldTypesInfo = [];
                        $addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
                        $lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];

                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 addField() has 105 lines of code. Current threshold is set to 100. Avoid really long methods.
                Open

                    public function addField($fieldType, $blockId, $params)
                    {
                        $label = $params['fieldLabel'];
                        $name = strtolower($params['fieldName']);
                        $pickListValues = [];

                The method addField() has an NPath complexity of 12960. The configured NPath complexity threshold is 200.
                Open

                    public function addField($fieldType, $blockId, $params)
                    {
                        $label = $params['fieldLabel'];
                        $name = strtolower($params['fieldName']);
                        $pickListValues = [];

                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 validate() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10.
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                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 addField() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10.
                Open

                    public function addField($fieldType, $blockId, $params)
                    {
                        $label = $params['fieldLabel'];
                        $name = strtolower($params['fieldName']);
                        $pickListValues = [];

                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 getTypeDetailsForAddField() has a Cyclomatic Complexity of 40. The configured cyclomatic complexity threshold is 10.
                Open

                    public function getTypeDetailsForAddField($fieldType, $params)
                    {
                        $displayType = 1;
                        $importerType = new \App\Db\Importers\Base();
                        switch ($fieldType) {

                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 getAddFieldTypeInfo() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
                Open

                    public function getAddFieldTypeInfo()
                    {
                        $fieldTypesInfo = [];
                        $addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
                        $lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];

                CyclomaticComplexity

                Since: 0.1

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

                Example

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

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

                Reduce the number of switch cases from 38 to at most 30.
                Open

                        switch ($fieldType) {

                When switch statements have large sets of case clauses, it is usually an attempt to map two sets of data. A real map structure would be more readable and maintainable, and should be used instead.

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

                class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model

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

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

                    public function getAddFieldTypeInfo()

                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 34 to the 15 allowed.
                Open

                    public function validate(array $data, bool $throw = true)

                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 17 to the 15 allowed.
                Open

                    public function addField($fieldType, $blockId, $params)

                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 20 to the 15 allowed.
                Open

                    public function getMissingSystemFields(): array

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

                See

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

                    public function getTypeDetailsForAddField($fieldType, $params)

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

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

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

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

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

                class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
                {
                    /** {@inheritdoc} */
                    public $name = 'LayoutEditor';
                    /** @var string Parent name */

                CouplingBetweenObjects

                Since: 1.1.0

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

                Example

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

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

                Missing class import via use statement (line '259', column '16').
                Open

                                    throw new \App\Exceptions\AppException($message, $code);

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '308', column '10').
                Open

                                (new \App\BatchMethod(['method' => '\App\Fields\Token::setTokens', 'params' => [$name, $moduleName]]))->save();

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '354', column '25').
                Open

                            $fieldInstance = new vtlib\Field();

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '851', column '35').
                Open

                        ) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());

                MissingImport

                Since: 2.7.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '659', column '15').
                Open

                        return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '850', column '13').
                Open

                            && !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists()

                MissingImport

                Since: 2.7.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '671', column '15').
                Open

                        return (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $this->getId()])

                MissingImport

                Since: 2.7.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);

                MissingImport

                Since: 2.7.0

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

                Example

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

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

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

                    public function getFields($blockInstance = false)

                BooleanArgumentFlag

                Since: 1.4.0

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

                Example

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

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

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

                    public function validate(array $data, bool $throw = true)

                BooleanArgumentFlag

                Since: 1.4.0

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

                Example

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

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

                Missing class import via use statement (line '395', column '23').
                Open

                        $importerType = new \App\Db\Importers\Base();

                MissingImport

                Since: 2.7.0

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

                Example

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

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

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

                        $query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '942', column '15').
                Open

                        return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '708', column '15').
                Open

                        return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->createCommand()->queryAllByGroup();

                MissingImport

                Since: 2.7.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '332', column '21').
                Open

                        $fieldModel = new Settings_LayoutEditor_Field_Model();

                MissingImport

                Since: 2.7.0

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

                Example

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

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

                Missing class import via use statement (line '956', column '34').
                Open

                        $relatedReferenceFields = (new \App\Db\Query())

                MissingImport

                Since: 2.7.0

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

                Example

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

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

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

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                IfStatementAssignment

                Since: 2.7.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_DUPLICATES_VALUES_FOUND', 'Other.Exceptions');

                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 getTableName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                } else {
                                    $tableName = $focus->table_name . 'cf';
                                }

                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 'Settings_WebserviceApps_Module_Model' in method 'getMissingSystemFields'.
                Open

                        foreach (Settings_WebserviceApps_Module_Model::getServers() as $id => $field) {

                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_Field_Model' in method 'getMultiReferenceFieldsRelatedWithModule'.
                Open

                            $fieldModel = Vtiger_Field_Model::getInstanceFromFieldId($fieldId);

                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 '241', column '12').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                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 '228', column '113').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                IfStatementAssignment

                Since: 2.7.0

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

                Example

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

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

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

                                            $message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

                Avoid using static access to class 'vtlib\Module' in method 'addField'.
                Open

                                $targetModule = vtlib\Module::getInstance($module);

                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 isFieldsSortableAllowed uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                            } else {
                                return false;
                            }

                ElseExpression

                Since: 1.4.0

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

                Example

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

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

                Avoid using static access to class 'Vtiger_Relation_Model' in method 'getRelations'.
                Open

                            $this->relations = Vtiger_Relation_Model::getAllRelations($this->getSourceModule(), false, true, true);

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');

                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 getTypeDetailsForAddField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                } else {
                                    $dbfldlength = $fieldLength + $decimal + 1;
                                }

                ElseExpression

                Since: 1.4.0

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

                Example

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

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

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

                        $sourceModule = \App\Module::getModuleId($sourceModule);

                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 addField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                            } else {
                                $moduleList = $params['referenceModule'];
                            }

                ElseExpression

                Since: 1.4.0

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

                Example

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

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

                Avoid using static access to class '\App\Relation' in method 'updateRelatedViewType'.
                Open

                        \App\Relation::clearCacheById($relationId);

                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 '244', column '17').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                IfStatementAssignment

                Since: 2.7.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_EXCEEDED_MAXIMUM_NUMBER_CHARACTERS_FOR_FIELD_NAME', 'Settings::LayoutEditor');

                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 '234', column '10').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                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 getMissingSystemFields uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                            } else {
                                $exist = true;
                                foreach ($validationConditions as $validationCondition) {
                                    $status = true;
                                    foreach ($fields as $fieldModel) {

                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 'Settings_LayoutEditor_Block_Model' in method 'getBlocks'.
                Open

                            $moduleBlocks = Settings_LayoutEditor_Block_Model::getAllForModule($this->sourceModule);

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');

                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 'addField'.
                Open

                            ->set('fieldparams', $params['fieldparams'] ?? ($fieldParams ? \App\Json::encode($fieldParams) : ''))

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

                Avoid using static access to class '\App\Purifier' in method 'validate'.
                Open

                                        if (($result = preg_match('/[\<\>\"\#\,]/', $val)) || ($result = preg_match('/[\<\>\"\#\,]/', \App\Purifier::decodeHtml($val)))) {

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor');

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                                        $message = \App\Language::translate('LBL_WRONG_FIELD_TYPE', 'Settings::LayoutEditor');

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);

                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 'getFieldsForWebserviceApps'.
                Open

                        return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];

                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 '216', column '10').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                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 'CRMEntity' in method 'getTableName'.
                Open

                            $focus = CRMEntity::getInstance($this->getSourceModule()->getName());

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);

                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_Block_Model' in method 'addSystemField'.
                Open

                        $blockModel = Vtiger_Block_Model::getInstance($blockId, $this->getSourceModule()->getName());

                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 'setSourceModule'.
                Open

                        $this->sourceModule = \Vtiger_Module_Model::getInstance($sourceModule);

                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_Block_Model' in method 'addField'.
                Open

                        $blockModel = Vtiger_Block_Model::getInstance($blockId, $moduleName);

                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 'Settings_LayoutEditor_Field_Model' in method 'getFields'.
                Open

                                $fieldList = Settings_LayoutEditor_Field_Model::getInstanceFromBlockIdList($blockId);

                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 '241', column '62').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                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 '219', column '16').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                IfStatementAssignment

                Since: 2.7.0

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

                Example

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

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

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

                                            $message = \App\Language::translate('ERR_EXCEEDED_NUMBER_CHARACTERS', 'Other.Exceptions');

                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 'addField'.
                Open

                        App\Cache::clear();

                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 getTableName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $tableName = $type;
                        }

                ElseExpression

                Since: 1.4.0

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

                Example

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

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

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

                                'label' => $field['name'] . ' (' . \App\Language::translate($field['type'], 'Settings:WebserviceApps') . ')',

                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 '209', column '10').
                Open

                    public function validate(array $data, bool $throw = true)
                    {
                        $message = null;
                        $code = null;
                        $result = false;

                IfStatementAssignment

                Since: 2.7.0

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

                Example

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

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

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

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                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 'checkIfPicklistFieldNameReserved'.
                Open

                            \App\Fields\Picklist::isPicklistExist($fieldName)

                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 'checkIfPicklistFieldNameReserved'.
                Open

                        ) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());

                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_Field_Model' in method 'getMissingSystemFields'.
                Open

                                $missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['name']);

                StaticAccess

                Since: 1.4.0

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

                Example

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

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

                Define a constant instead of duplicating this literal "MultipicklistTags" 4 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "Currency" 5 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                            ->set('uitype', $details['uitype'])

                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 "Related1M" 4 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "MultiReferenceValue" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "header_field" 3 times.
                Open

                        'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',

                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 "referenceModule" 4 times.
                Open

                                    'module' => $params['referenceModule']

                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 "generatedtype" 3 times.
                Open

                        'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                            ->andWhere(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists();

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                        return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                            ->set('typeofdata', $details['typeofdata'])

                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 "MultiReference" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "MapCoordinates" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

                Define a constant instead of duplicating this literal "Settings::LayoutEditor" 11 times.
                Open

                                        $message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');

                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 "module" 4 times.
                Open

                                    'module' => $params['MRVModule'],

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                            $name = 'share_externally_' . $id;

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

                Noncompliant Code Example

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

                See

                Define a constant instead of duplicating this literal "fieldparams" 4 times.
                Open

                            ->set('fieldparams', $params['fieldparams'] ?? ($fieldParams ? \App\Json::encode($fieldParams) : ''))

                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 "summaryfield" 3 times.
                Open

                        'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',

                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 "Token" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                        if (isset($details['displayType']) || isset($params['displayType'])) {

                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 "tabid" 4 times.
                Open

                        return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();

                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 "Integer" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "Other.Exceptions" 3 times.
                Open

                                            $message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');

                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 "pickListValues" 6 times.
                Open

                                case 'pickListValues':

                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 "fieldType" 3 times.
                Open

                                    } elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {

                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 "quickcreate" 3 times.
                Open

                        'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',

                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 "Decimal" 4 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "CategoryMultipicklist" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "AdvPercentage" 4 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "Picklist" 6 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "MultiSelectCombo" 5 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                                        $message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                        'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',

                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 "ServerAccess" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "Group" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "Phone" 3 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

                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 "fieldLength" 6 times.
                Open

                            $fieldModel->set('maximumlength', $params['fieldLength'] ?? null);

                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 "Editor" 5 times.
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

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

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

                Noncompliant Code Example

                With the default threshold of 3:

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

                Compliant Solution

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

                Exceptions

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

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

                        $name = strtolower($params['fieldName']);

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

                Noncompliant Code Example

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

                See

                Avoid unused parameters such as '$blockInstance'.
                Open

                    public function getFields($blockInstance = false)

                UnusedFormalParameter

                Since: 0.2

                Avoid passing parameters to methods or constructors and then not using those parameters.

                Example

                class Foo
                {
                    private function bar($howdy)
                    {
                        // $howdy is not used
                    }
                }

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

                Assigning false to property but \Settings_LayoutEditor_Module_Model::$supportedModules is string[]
                Open

                    public static $supportedModules = false;

                Reference to undeclared property \CRMEntity->table_name
                Open

                                    $tableName = $focus->table_name . 'cf';

                Return type of getTypeDetailsForAddField() is undeclared type \sting[] (Did you mean string)
                Open

                    public function getTypeDetailsForAddField($fieldType, $params)

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType(30)->defaultValue('');

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->boolean()->defaultValue(false);

                Reference to undeclared property \Settings_LayoutEditor_Module_Model->blocks (Did you mean $block)
                Open

                        return $this->blocks;

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType($fieldLength)->defaultValue('');

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType()->defaultValue('');

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType($fieldLength)->defaultValue('');

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType(Vtiger_Token_UIType::MAX_LENGTH)->defaultValue('');

                Reference to undeclared property \CRMEntity->customFieldTable
                Open

                                    $tableName = $focus->customFieldTable[0];

                Reference to undeclared property \Settings_LayoutEditor_Module_Model->blocks
                Open

                        if (empty($this->blocks)) {

                Argument 2 (code) is ?512|?513 but \App\Exceptions\AppException::__construct() takes int
                Open

                                    throw new \App\Exceptions\AppException($message, $code);

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->boolean()->defaultValue(false);

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType(30)->defaultValue('');

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->integer($fieldLength)->defaultValue(0);

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->integer()->defaultValue(null)->unsigned();

                Reference to undeclared property \Settings_LayoutEditor_Module_Model->fields
                Open

                        return $this->fields;

                Argument 1 (module) is false but \CRMEntity::getInstance() takes string defined at /code/include/CRMEntity.php:61
                Open

                            $focus = CRMEntity::getInstance($this->getSourceModule()->getName());

                Reference to undeclared property \CRMEntity->customFieldTable
                Open

                                if (isset($focus->customFieldTable)) {

                Assigning string to property but \vtlib\Field->column is false
                Open

                            $fieldInstance->column = $name . '_extra';

                Variable $uitype is undeclared
                Open

                                $uitype = $uitype ?? 7;

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType(100)->defaultValue('');

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType()->defaultValue('');

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->integer(10)->defaultValue(0)->unsigned();

                Reference to undeclared property \Settings_LayoutEditor_Module_Model->blocks (Did you mean $block)
                Open

                            $this->blocks = $blocksList;

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

                        return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();

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

                        return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];

                Reference to undeclared property \Settings_LayoutEditor_Module_Model->fields
                Open

                        if (empty($this->fields)) {

                Reference to undeclared property \Settings_LayoutEditor_Module_Model->fields
                Open

                            $this->fields = $fieldList;

                Assigning string to property but \vtlib\Field->table is false
                Open

                            $fieldInstance->table = $tableName;

                Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
                Open

                                $missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['name']);

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

                                \App\Db::getInstance()->createCommand()->insert('s_#__multireference', ['source_module' => $moduleName, 'dest_module' => $params['MRVModule']])->execute();

                Returning type array{uitype:1|5|7|9|10|11|13|14|15|16|17|18|21|33|35|56|69|71|79|85|300|302|305|308|309|311|313|314|316|318|319|321|324|330|331|333|365|null,typeofdata:'C\x7eO'|'DT\x7eO'|'D\x7eO'|'E\x7eO'|'I\x7eO'|'NN\x7eO'|'N\x7eO'|'N\x7eO\x7e2\x7e2'|'T\x7eO'|'V\x7eO'|'V\x7eO\x7eLE\x7e15'|null|string,dbType:\yii\db\ColumnSchemaBuilder|null,displayType:1|3|5} but getTypeDetailsForAddField() is declared to return \sting[]|int[]
                Open

                            'uitype' => $uitype,

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

                        return (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $this->getId()])

                Argument 1 (message) is ?string but \App\Exceptions\AppException::__construct() takes string
                Open

                                    throw new \App\Exceptions\AppException($message, $code);

                Call to method defaultValue from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->stringType()->defaultValue('');

                Reference to undeclared property \CRMEntity->table_name
                Open

                                $tableName = $focus->table_name;

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

                        $relatedReferenceFields = (new \App\Db\Query())

                Call to method null from undeclared class \yii\db\ColumnSchemaBuilder (Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder)
                Open

                                $type = $importerType->integer()->null();

                Returning type ?string but getTableName() is declared to return string
                Open

                        return $tableName;

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

                                $moduleList[] = $params['referenceModule'];

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

                        return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->createCommand()->queryAllByGroup();

                Saw an @param annotation for sourceModule, but it was not found in the param list of function getMultiReferenceFieldsRelatedWithModule(string $moduleName) : \Vtiger_Field_Model[]|array
                Open

                     * @param string $sourceModule Source module name

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

                        \App\Db::getInstance()->createCommand()->update('vtiger_relatedlists', ['view_type' => implode(',', $type)], ['relation_id' => $relationId])->execute();

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

                        $query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);

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

                        ) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());

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

                            && !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists()

                This branch's code block is the same as the block for the branch on line 222.
                Open

                                    } elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {
                                        $message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');
                                        $code = 512;
                                    }

                Having two cases in a switch statement or two branches in an if chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if chain they should be combined, or for a switch, one should fall through to the other.

                Noncompliant Code Example

                switch ($i) {
                  case 1:
                    doSomething();
                    break;
                  case 2:
                    doSomethingDifferent();
                    break;
                  case 3:  // Noncompliant; duplicates case 1's implementation
                    doSomething();
                    break;
                  default:
                    doTheRest();
                }
                
                if ($a >= 0 && $a < 10) {
                  doTheThing();
                else if ($a >= 10 && $a < 20) {
                  doTheOtherThing();
                }
                else if ($a >= 20 && $a < 50) {
                  doTheThing();  // Noncompliant; duplicates first condition
                }
                else {
                  doTheRest();
                }
                
                if ($b == 0) {
                  doOneMoreThing();
                }
                else {
                  doOneMoreThing(); // Noncompliant; duplicates then-branch
                }
                
                var b = a ? 12 > 4 : 4;  // Noncompliant; always results in the same value
                

                Compliant Solution

                switch ($i) {
                  case 1:
                  case 3:
                    doSomething();
                    break;
                  case 2:
                    doSomethingDifferent();
                    break;
                  default:
                    doTheRest();
                }
                
                if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) {
                  doTheThing();
                else if ($a >= 10 && $a < 20) {
                  doTheOtherThing();
                }
                else {
                  doTheRest();
                }
                
                doOneMoreThing();
                
                b = 4;
                

                or

                switch ($i) {
                  case 1:
                    doSomething();
                    break;
                  case 2:
                    doSomethingDifferent();
                    break;
                  case 3:
                    doThirdThing();
                    break;
                  default:
                    doTheRest();
                }
                
                if ($a >= 0 && $a < 10) {
                  doTheThing();
                else if ($a >= 10 && $a < 20) {
                  doTheOtherThing();
                }
                else if ($a >= 20 && $a < 50) {
                  doTheThirdThing();
                }
                else {
                  doTheRest();
                }
                
                if ($b == 0) {
                  doOneMoreThing();
                }
                else {
                  doTheRest();
                }
                
                int b = a ? 12 > 4 : 8;
                

                Exceptions

                Blocks in an if chain that contain a single line of code are ignored, as are blocks in a switch statement that contain a single line of code with or without a following break.

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

                        $lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];

                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 $addFieldSupportedTypes. Keep variable name length under 20.
                Open

                        $addFieldSupportedTypes = $this->getAddSupportedFieldTypes();

                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 $blocksEliminatedArray. Keep variable name length under 20.
                Open

                        $blocksEliminatedArray = ['HelpDesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],

                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 $relatedReferenceFields. Keep variable name length under 20.
                Open

                        $relatedReferenceFields = (new \App\Db\Query())

                LongVariable

                Since: 0.2

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

                Example

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

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

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

                class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model

                The class Settings_LayoutEditor_Module_Model is not named in CamelCase.
                Open

                class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
                {
                    /** {@inheritdoc} */
                    public $name = 'LayoutEditor';
                    /** @var string Parent name */

                CamelCaseClassName

                Since: 0.2

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

                Example

                class class_name {
                }

                Source

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

                    /** @var string Parent name */

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

                        'SummaryTop' => 'LBL_SUMMARY_TOP_TYPE',

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

                    /** @var string[] List of supported relation types */

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

                        'getRelatedList' => 'PLL_RELATED_LIST',

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

                        // 'getActivities' => 'PLL_ACTIVITIES',

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

                        //'getDependentsList' => 'PLL_DEPENDENTS_LIST',

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

                    /** @var string[] List of supported modules */

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

                    /** @var string[] List of fields in edit view modal */

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

                    public $name = 'LayoutEditor';

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

                    const TYPES = [

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

                    public const RELATED_VIEW_TYPE = [

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

                        'getAttachments' => 'PLL_ATTACHMENTS',

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

                        'RelatedTab' => 'LBL_RELATED_TAB_TYPE',

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

                    public static $supportedModules = false;

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

                    ];

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

                    /** {@inheritdoc} */

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

                    /** {@inheritdoc} */

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

                        'getMultiReference' => 'PLL_MULTI_REFERENCE',

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

                        'DetailBottom' => 'LBL_DETAIL_BOTTOM_TYPE',

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

                        'SummaryBottom' => 'LBL_SUMMARY_BOTTOM_TYPE',

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

                    public $parent = 'Settings';

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

                    public $isentitytype = false;

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

                        'DetailTop' => 'LBL_DETAIL_TOP_TYPE',

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

                    ];

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

                        'getManyToMany' => 'PLL_SPLITED_RELATED_LIST',

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

                        'getEmails' => 'PLL_EMAILS',

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

                    /** @var string[] Related view types. */

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

                     * @return string

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

                     *

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

                            $details = [];

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

                                if ('Currency' === $fieldType) {

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

                                $details['ModuleListMultiple'] = true;

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

                     *

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

                    ];

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

                     *

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

                     * @return int

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

                     * Gets parent name.

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

                        }

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

                        return $this;

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

                                    $blocksList[$block->get('label')] = $block;

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

                    public function getAddFieldTypeInfo()

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

                        $addFieldSupportedTypes = $this->getAddSupportedFieldTypes();

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

                    public function getSourceModule(): Vtiger_Module_Model

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

                                //including mantisaa and integer part

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

                     * Verification of data.

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

                     * Function that returns all the fields for the module.

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

                     * @param mixed $blockInstance

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

                        if (empty($this->fields)) {

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

                            $blockId = [];

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

                     */

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

                    public function getAddSupportedFieldTypes()

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

                        $lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];

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

                    }

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

                    public $sourceModule;

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

                    /**

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

                     *

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

                     *

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

                     * Function which will give information about the field types that are supported for add.

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

                            if (\in_array($fieldType, $lengthSupportedFieldTypes)) {

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

                                $details['lengthsupported'] = true;

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

                                $details['preDefinedValueType'] = 'text';

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

                     * Get source module model.

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

                     */

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

                        return $this->sourceModule;

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

                     */

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

                            }

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

                    }

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

                     * List of supported field types.

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

                            }

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

                     *

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

                    }

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

                            if (\count($blockId) > 0) {

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

                     * Function returns all the blocks for the module.

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

                     * @return Vtiger_Block_Model[] - list of block models

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

                    {

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

                                if ($block->get('label')) {

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

                        return $this->blocks;

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

                    {

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

                            if ('Picklist' === $fieldType || 'MultiSelectCombo' === $fieldType || 'MultipicklistTags' === $fieldType) {

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

                            if ('Related1M' === $fieldType) {

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

                            }

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

                     *

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

                            }

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

                                $fieldList = Settings_LayoutEditor_Field_Model::getInstanceFromBlockIdList($blockId);

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

                            $blocksList = [];

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

                            $moduleBlocks = Settings_LayoutEditor_Block_Model::getAllForModule($this->sourceModule);

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

                            $this->blocks = $blocksList;

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

                    /**

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

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

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

                            if ('Decimal' === $fieldType || 'Currency' === $fieldType || 'AdvPercentage' === $fieldType) {

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

                        }

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

                     * @param bool  $throw

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

                     * Function to get the Module/Tab id.

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

                    }

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

                    /**

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

                    {

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

                                $blockId[] = $block->get('id');

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

                        if (empty($this->blocks)) {

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

                        ];

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

                                if ('Picklist' === $fieldType) {

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

                            }

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

                            $fieldTypesInfo[$fieldType] = $details;

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

                        return $fieldTypesInfo;

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

                     * @param array $data

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

                    {

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

                     * @return Vtiger_Module_Model

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

                     *

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

                    {

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

                            foreach ($blocks as $block) {

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

                            foreach ($moduleBlocks as $block) {

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

                     * @return array

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

                            if ('Editor' === $fieldType) {

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

                                $details['maxLength'] = 64;

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

                                $details['preDefinedValueExists'] = true;

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

                     * @return $this

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

                    {

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

                        $this->sourceModule = \Vtiger_Module_Model::getInstance($sourceModule);

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

                     *

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

                            }

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

                                    $details['decimalReadonly'] = true;

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

                                }

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

                    /**

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

                     * @param string $sourceModule

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

                     */

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

                     * @return Vtiger_Field_Model[] - list of field models

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

                    public function getFields($blockInstance = false)

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

                            }

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

                    /**

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

                        }

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

                                $details['noLimitForLength'] = true;

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

                    const EDIT_FIELDS_FORM = [

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

                    }

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

                    }

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

                            $fieldList = [];

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

                     */

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

                    {

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

                                    $details['picklistoption'] = true;

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

                        'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',

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

                    public function getId()

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

                    public function setSourceModule(string $sourceModule)

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

                    {

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

                        return $this->fields;

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

                     */

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

                                }

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

                    /**

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

                        foreach ($addFieldSupportedTypes as $fieldType) {

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

                     */

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

                        return $this->getSourceModule()->getId();

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

                    /**

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

                    public function getParentName()

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

                        return $this->parent;

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

                    /**

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

                    public function getBlocks()

                Line exceeds 120 characters; contains 486 characters
                Open

                            'Text', 'Decimal', 'Integer',  'Currency',  'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage',  'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',

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

                    }

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

                        $fieldTypesInfo = [];

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

                                $details['decimalSupported'] = true;

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

                                //text area value type , can give multiple values

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

                    public $relations;

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

                    /** @var Vtiger_Module_Model Source module */

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

                     *

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

                     *

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

                                $details['maxFloatingDigits'] = 5;

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

                            }

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

                    /**

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

                     */

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

                    public function validate(array $data, bool $throw = true)

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

                        'displaytype', 'maxlengthtext', 'maxwidthcolumn', 'tabindex', 'mandatory', 'icon',

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

                    /** @var array Relations */

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

                     * Set source module.

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

                     */

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

                            $blocks = $this->getBlocks();

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

                            $this->fields = $fieldList;

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

                    }

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

                     * @return string[]

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

                        return [

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

                                }

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

                    {

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

                                    } elseif ($result = $this->checkFieldNameIsAnException($value)) {

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

                                    }

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

                                case 'pickListValues':

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

                                    foreach ($value as $val) {

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

                                        $code = 512;

                Line exceeds 120 characters; contains 171 characters
                Open

                                \App\Db::getInstance()->createCommand()->insert('s_#__multireference', ['source_module' => $moduleName, 'dest_module' => $params['MRVModule']])->execute();

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

                                break;

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

                            default:

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

                            ->set('uitype', $details['uitype'])

                Line exceeds 120 characters; contains 188 characters
                Open

                                    } elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {

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

                                    } elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {

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

                                            $code = 512;

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

                                            $message = \App\Language::translate('ERR_EXCEEDED_NUMBER_CHARACTERS', 'Other.Exceptions');

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

                            }

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

                                        $message = \App\Language::translate('LBL_WRONG_FIELD_TYPE', 'Settings::LayoutEditor');

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

                    /**

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

                                    break;

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

                        $label = $params['fieldLabel'];

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

                                            $message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');

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

                                break;

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

                            case 'Token':

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

                                        }

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

                                    'showType' => $params['isCoordinateType'] ?? 0,

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

                                return [$key => $message];

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

                        }

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

                    }

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

                     *

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

                     *

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

                            if ($result) {

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

                     * @param int    $blockId

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

                    {

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

                            case 'Tree':

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

                                break;

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

                            ->set('label', $label)

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

                            ->set('typeofdata', $details['typeofdata'])

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

                                case 'fieldType':

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

                                        } elseif ($result = \strlen($val) > 200) {

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

                     * @param string $fieldType

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

                        $pickListValues = [];

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

                            case 'CategoryMultipicklist':

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

                            case 'ServerAccess':

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

                                $fieldParams = [

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

                            ->set('header_field', $params['header_field'] ?? null)

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

                                    }

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

                                    } elseif (\strlen($value) > 30) {

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

                                        $code = 512;

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

                                        $code = 513;

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

                                $fieldParams = (int) $params['tree'];

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

                                        $message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');

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

                                        $message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');

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

                                    break;

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

                                        $message = \App\Language::translate('LBL_DUPLICATES_VALUES_FOUND', 'Other.Exceptions');

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

                        $moduleName = $this->getSourceModule()->getName();

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

                                    'module' => $params['referenceModule']

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

                                case 'fieldName':

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

                                break;

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

                        $name = strtolower($params['fieldName']);

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

                                ];

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

                            case 'MultiReferenceValue':

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

                                break;

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

                            ->set('fieldparams', $params['fieldparams'] ?? ($fieldParams ? \App\Json::encode($fieldParams) : ''))

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

                        if ('Editor' === $fieldType) {

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

                                ];

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

                                break;

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

                                $fieldParams = [

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

                        $fieldModel->set('name', $name)

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

                                    $value = strtolower($value);

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

                                        $message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');

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

                                    }

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

                        $message = null;

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

                     * @throws Exception

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

                                        $code = 513;

                Line exceeds 120 characters; contains 154 characters
                Open

                            $pickListValues = $params['pickListValues'] = \is_string($params['pickListValues']) ? [$params['pickListValues']] : $params['pickListValues'];

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

                                        $code = 512;

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

                                    break;

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

                        $fieldParams = '';

                Line exceeds 120 characters; contains 127 characters
                Open

                                (new \App\BatchMethod(['method' => '\App\Fields\Token::setTokens', 'params' => [$name, $moduleName]]))->save();

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

                                $fieldParams = [

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

                                    'type' => $params['type'] ?? null,

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

                            case 'MultiReference':

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

                                    'showAllGroups' => $params['showAllGroups'] ?? 0

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

                                    'showLocation' => $params['isCoordinateMeLokaction'] ?? 0,

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

                                        $message = \App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor');

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

                                        $code = 512;

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

                     * Add field.

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

                        $tableName = $this->getTableName($params['fieldTypeList']);

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

                        switch ($fieldType) {

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

                                    'filterValue' => $params['MRVFilterValue'] ?? null,

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

                                (new \App\BatchMethod(['method' => '\App\Fields\Token::setTokens', 'params' => [$name, $moduleName]]))->save();

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

                                $fieldParams = [

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

                            ->set('helpinfo', $params['helpinfo'] ?? '')

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

                        $result = false;

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

                                    if ($result = $this->checkFieldLabelExists($value)) {

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

                                        $message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');

                Line exceeds 120 characters; contains 143 characters
                Open

                                        $message = \App\Language::translate('LBL_EXCEEDED_MAXIMUM_NUMBER_CHARACTERS_FOR_FIELD_NAME', 'Settings::LayoutEditor');

                Line exceeds 120 characters; contains 135 characters
                Open

                                            $message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');

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

                                    break;

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

                                if ($throw) {

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

                                    'filterField' => $params['MRVFilterField'] ?? null,

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

                                ];

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

                        }

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

                            ->set('quickcreate', $params['quickcreate'] ?? 1)

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

                            ->set('summaryfield', $params['summaryfield'] ?? 0)

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

                        $code = null;

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

                                    break;

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

                                    if ($result = $this->checkFieldNameCharacters($value)) {

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

                            switch ($key) {

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

                                        $code = 512;

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

                                    }

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

                                case 'fieldLabel':

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

                                            $code = 512;

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

                                        if (($result = preg_match('/[\<\>\"\#\,]/', $val)) || ($result = preg_match('/[\<\>\"\#\,]/', \App\Purifier::decodeHtml($val)))) {

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

                                    }

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

                                default:

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

                     * @param array  $params

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

                                    throw new \App\Exceptions\AppException($message, $code);

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

                        if (\array_key_exists('pickListValues', $params)) {

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

                        return $result;

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

                                \App\Db::getInstance()->createCommand()->insert('s_#__multireference', ['source_module' => $moduleName, 'dest_module' => $params['MRVModule']])->execute();

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

                                    'field' => $params['MRVField'],

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

                                $fieldParams = (int) $params['server'];

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

                                break;

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

                                    } elseif ($result = $this->checkFieldNameExists($value)) {

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

                                        $code = 512;

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

                                break;

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

                            ->set('generatedtype', $params['generatedtype'] ?? 2)

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

                                        $message = \App\Language::translate('LBL_EXCEEDED_MAXIMUM_NUMBER_CHARACTERS_FOR_FIELD_NAME', 'Settings::LayoutEditor');

                Line exceeds 120 characters; contains 154 characters
                Open

                                        if (($result = preg_match('/[\<\>\"\#\,]/', $val)) || ($result = preg_match('/[\<\>\"\#\,]/', \App\Purifier::decodeHtml($val)))) {

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

                                    if (\count($value) !== \count(array_unique(array_map('strtolower', $value)))) {

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

                        $fieldModel = new Settings_LayoutEditor_Field_Model();

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

                     *

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

                     * @return \Settings_LayoutEditor_Field_Model

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

                            ->set('columntype', $details['dbType']);

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

                     */

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

                            $pickListValues = $params['pickListValues'] = \is_string($params['pickListValues']) ? [$params['pickListValues']] : $params['pickListValues'];

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

                                    'module' => $params['MRVModule'],

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

                                    'showMap' => $params['isCoordinateMap'] ?? 0,

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

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

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

                                    if ($result = !\in_array($value, $this->getAddSupportedFieldTypes())) {

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

                                }

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

                            }

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

                    public function addField($fieldType, $blockId, $params)

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

                        }

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

                        $this->validate($params);

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

                            case 'MapCoordinates':

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

                                ];

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

                            case 'Group':

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

                        $details = $this->getTypeDetailsForAddField($fieldType, $params);

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

                            ->set('table', $tableName)

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

                            $fieldInstance->column = $name . '_extra';

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

                        if ('Picklist' === $fieldType || 'MultiSelectCombo' === $fieldType || 'MultipicklistTags' === $fieldType) {

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

                    /**

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

                            case 'Decimal':

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

                                break;

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

                                if (!empty($params['isRoleBasedPickList'])) {

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

                                $uichekdata = 'V~O';

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

                                $uitype = 17;

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

                                $type = $importerType->stringType()->defaultValue('');

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

                        if ('Phone' === $fieldType) {

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

                                $targetModule->setRelatedList($this->getSourceModule(), $moduleName, ['Add'], 'getDependentsList', $name);

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

                     *

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

                                $uitype = 365;

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

                                $uitype = 9;

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

                                if (1 == $fieldLength) {

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

                                    $dbfldlength = $fieldLength + $decimal + 1;

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

                                $type = $importerType->stringType(100)->defaultValue('');

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

                                $type = $importerType->boolean()->defaultValue(false);

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

                                $uitype = 7;

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

                            $fieldInstance = new vtlib\Field();

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

                            $fieldInstance->label = 'FL_PHONE_CUSTOM_INFORMATION';

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

                        $importerType = new \App\Db\Importers\Base();

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

                                break;

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

                                }

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

                                break;

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

                        }

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

                        $blockModel = Vtiger_Block_Model::getInstance($blockId, $moduleName);

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

                            $fieldInstance->maxlengthtext = 100;

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

                        App\Cache::clear();

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

                                $uitype = 1;

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

                                // no break

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

                                $fieldLength = $params['fieldLength'];

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

                                $type = $importerType->text();

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

                                $uichekdata = 'V~O';

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

                            $fieldModel->set('maximumlength', $params['fieldLength'] ?? null);

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

                            $fieldInstance->name = $name . '_extra';

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

                                $moduleList = $params['referenceModule'];

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

                            foreach ($moduleList as $module) {

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

                                $targetModule = vtlib\Module::getInstance($module);

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

                        return $fieldModel;

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

                                $uitype = $uitype ?? 7;

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

                            case 'Date':

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

                                    $uitype = 15;

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

                                $uitype = 18;

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

                            case 'TextArea':

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

                                $uitype = 21;

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

                                $type = $importerType->text();

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

                                $uichekdata = 'V~O';

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

                                $type = $importerType->integer($fieldLength)->defaultValue(0);

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

                        if (isset($details['displayType']) || isset($params['displayType'])) {

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

                        }

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

                                $type = $importerType->stringType($fieldLength)->defaultValue('');

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

                                $uitype = 16;

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

                                }

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

                            case 'URL':

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

                                break;

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

                            $fieldInstance->table = $tableName;

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

                     * Function defines details of the created field.

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

                                $uichekdata = 'D~O';

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

                                break;

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

                                $uichekdata = 'V~O';

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

                        switch ($fieldType) {

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

                                break;

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

                                $uichekdata = 'V~O';

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

                                $uichekdata = 'C~O';

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

                                $type = $importerType->text();

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

                                $uitype = 33;

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

                                break;

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

                                $uichekdata = 'I~O';

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

                            $fieldInstance->save($blockModel);

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

                            } else {

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

                     *

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

                     */

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

                                $uichekdata = 'V~O~LE~' . $fieldLength;

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

                                $decimal = $params['decimal'];

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

                                $dbfldlength = $fieldLength + $decimal + 1;

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

                                $type = $importerType->decimal($dbfldlength, $decimal);

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

                                $type = $importerType->date();

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

                            case 'Time':

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

                                $uitype = 14;

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

                                break;

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

                                break;

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

                            case 'Skype':

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

                                $uitype = 85;

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

                            $fieldModel->set('displaytype', $params['displayType'] ?? $details['displayType']);

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

                            $fieldInstance->displaytype = 3;

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

                     * @param string $fieldType

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

                    public function getTypeDetailsForAddField($fieldType, $params)

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

                                $fieldLength = $params['fieldLength'];

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

                                break;

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

                     * @return (sting|int)[]

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

                            case 'Percent':

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

                                $decimal = $params['decimal'];

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

                                $uitype = 71;

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

                                $decimal = $decimal + 3;

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

                                $uichekdata = 'N~O';

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

                                break;

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

                            case 'Phone':

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

                                $uitype = 11;

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

                                $uichekdata = 'V~O';

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

                            case 'MultipicklistTags':

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

                                $uitype = 56;

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

                            case 'MultiSelectCombo':

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

                                $type = $importerType->stringType()->defaultValue('');

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

                        }

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

                        $blockModel->addField($fieldModel);

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

                            if (!\is_array($params['referenceModule'])) {

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

                            }

                Line exceeds 120 characters; contains 122 characters
                Open

                                $targetModule->setRelatedList($this->getSourceModule(), $moduleName, ['Add'], 'getDependentsList', $name);

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

                     * @param array  $params

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

                                } else {

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

                                $uitype = 5;

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

                                $uitype = 13;

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

                                $type = $importerType->time();

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

                                $type = $importerType->stringType()->defaultValue('');

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

                                break;

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

                            case 'Checkbox':

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

                                break;

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

                        }

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

                            $fieldModel->setRelatedModules($moduleList);

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

                    }

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

                                $fieldLength = $params['fieldLength'];

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

                                $type = $importerType->decimal($dbfldlength, $decimal);

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

                                // Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6363

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

                                $uichekdata = 'T~O';

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

                                $type = $importerType->stringType(30)->defaultValue('');

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

                            $fieldInstance->uitype = 1;

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

                        }

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

                            $fieldModel->setPicklistValues($pickListValues);

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

                        if ('Related1M' === $fieldType) {

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

                            }

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

                                $uichekdata = 'NN~O';

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

                                    $dbfldlength = $fieldLength + $decimal + 2;

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

                            case 'Email':

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

                            case 'Picklist':

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

                                $uichekdata = 'V~O';

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

                    {

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

                                $uichekdata = 'N~O~2~2';

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

                            case 'Currency':

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

                                break;

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

                            case 'Integer':

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

                                $fieldLength = $params['fieldLength'];

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

                            $fieldInstance->typeofdata = 'V~O';

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

                                $moduleList[] = $params['referenceModule'];

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

                        $displayType = 1;

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

                            case 'Text':

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

                            case 'AdvPercentage':

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

                                $type = $importerType->decimal(5, 2);

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

                                break;

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

                                $uichekdata = 'E~O';

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

                                break;

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

                                $uitype = 69;

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

                                $uitype = 309;

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

                                $uitype = 330;

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

                                break;

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

                        }

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

                                    $tableName = $focus->table_name . 'cf';

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

                            }

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

                     * @return bool

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

                            case 'Image':

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

                                $type = $importerType->text();

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

                                $uitype = 316;

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

                                } else {

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

                        } else {

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

                                break;

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

                                $type = $importerType->text($fieldLength);

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

                                break;

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

                                $type = $importerType->text();

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

                                break;

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

                                $uitype = 79;

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

                                break;

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

                            case 'Country':

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

                                $uichekdata = 'V~O';

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

                                $uichekdata = 'V~O';

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

                                break;

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

                                $type = $importerType->boolean()->defaultValue(false);

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

                                $type = $importerType->integer(10);

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

                     */

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

                                }

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

                    /**

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

                                $type = $importerType->integer(10)->defaultValue(0)->unsigned();

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

                            case 'MultiImage':

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

                            case 'Smtp':

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

                                $uitype = 10;

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

                                $uichekdata = 'V~O';

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

                                $fieldLength = $params['fieldLength'];

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

                                $uichekdata = 'I~O';

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

                                $type = $importerType->integer()->null();

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

                            case 'MultiReferenceValue':

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

                            case 'Token':

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

                                $uichekdata = 'V~O';

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

                                $type = $importerType->text();

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

                                $uitype = 35;

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

                            'typeofdata' => $uichekdata,

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

                     *

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

                                $fieldLength = Vtiger_Twitter_UIType::MAX_LENGTH;

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

                                $type = $importerType->text();

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

                                $type = $importerType->stringType(30)->defaultValue('');

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

                            default:

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

                                break;

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

                     *

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

                                $type = $importerType->dateTime();

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

                     * @return string

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

                                $uitype = 313;

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

                    {

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

                                $type = $importerType->stringType($fieldLength)->defaultValue('');

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

                            if (0 == $type) {

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

                                $uichekdata = 'C~O';

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

                                $tableName = $focus->table_name;

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

                                $uichekdata = 'V~O';

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

                            case 'MultiAttachment':

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

                    }

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

                    public function getTableName($type)

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

                                if (isset($focus->customFieldTable)) {

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

                     *

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

                                $uitype = 300;

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

                                break;

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

                            case 'Group':

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

                        ];

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

                            } elseif (1 == $type) {

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

                        }

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

                                $uichekdata = 'V~O';

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

                            case 'Editor':

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

                                $uitype = 302;

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

                            case 'CategoryMultipicklist':

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

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'ServerAccess':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 333;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'I~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'uitype' => $uitype,

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Get table name.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $tableName;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 305;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->text();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 314;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'RangeTime':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->stringType(Vtiger_Token_UIType::MAX_LENGTH)->defaultValue('');

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O~LE~' . $fieldLength;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 324;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'MapCoordinates':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 331;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'displayType' => $displayType,

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'Twitter':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $type

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 311;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->text();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'DateTime':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->stringType(255);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->text();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 319;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->text();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $displayType = 3;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $tableName = $type;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $name

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'DT~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 308;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 321;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'dbType' => $type,

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $tableName = $focus->customFieldTable[0];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function checkFieldNameCharacters($name): bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'Tree':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uitype = 318;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->stringType(100);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return [

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (\is_int($type)) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $type = $importerType->integer()->defaultValue(null)->unsigned();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'MultiReference':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $uichekdata = 'V~O';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return preg_match('#[^a-z0-9_]#is', $name) || !preg_match('/[a-z]/i', $name) || false !== strpos($name, ' ');

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'Related1M':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $displayType = 5;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'MultiEmail':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                break;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            case 'MultiDomain':

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $focus = CRMEntity::getInstance($this->getSourceModule()->getName());

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Check field name characters.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function checkFieldLabelExists(string $fieldLabel): bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            ->andWhere(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $fieldName

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'id', 'seq', 'header_type', 'header_class',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Function returns available templates for tree type field.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $sourceModule

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $dataReader = $query->createCommand()->query();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Check if field exists.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function isBlockSortableAllowed(): bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $dataReader->close();

                Line exceeds 120 characters; contains 134 characters
                Open

                        return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return string[] List of Entity modules

                Line exceeds 120 characters; contains 233 characters
                Open

                        return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->createCommand()->queryAllByGroup();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Line exceeds 120 characters; contains 140 characters
                Open

                            'Calendar' => ['LBL_TASK_INFORMATION', 'LBL_DESCRIPTION_INFORMATION', 'LBL_REMINDER_INFORMATION', 'LBL_RECURRENCE_INFORMATION'],

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return \in_array($fieldName, [

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Line exceeds 120 characters; contains 185 characters
                Open

                        $query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function checkFieldNameExists(string $fieldName): bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function isTypeChangeAllowed()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (null === $this->relations) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $fieldLabel

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $fieldName

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'Calendar' => ['LBL_TASK_INFORMATION', 'LBL_DESCRIPTION_INFORMATION', 'LBL_REMINDER_INFORMATION', 'LBL_RECURRENCE_INFORMATION'],

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Get relations.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Function to check field is editable or not.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return true;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $this->getSourceModule()->isTypeChangeAllowed();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function getTreeTemplates($sourceModule)

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function isSortableAllowed()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Function to check fields are sortable for the block.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function getEntityInstance()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Check if label exists.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param mixed $blockName

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if (!empty($blocksEliminatedArray[$moduleName])) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function getRelations()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $treeList[$row['templateid']] = $row['name'];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function checkFieldNameIsAnException(string $fieldName)

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'module', 'parent', 'action', 'mode', 'view', 'selected_ids',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'source_module', 'viewname', 'sortorder', 'orderby', 'inventory', 'private', 'src_record', 'relationid', 'relation_id', 'picklist', 'overwritten_shownerid', 'relationoperation', 'sourcemodule', 'sourcerecord'

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public static function getEntityModulesList()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                return false;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $this->relations = Vtiger_Relation_Model::getAllRelations($this->getSourceModule(), false, true, true);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return self::$supportedModules;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Function to get Entity module names list.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Function to check blocks are sortable for the module.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function isFieldsSortableAllowed($blockName)

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        ];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                if (\in_array($blockName, $blocksEliminatedArray[$moduleName])) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            } else {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /** {@inheritdoc} */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /** {@inheritdoc} */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Check if the field name is reserved.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $moduleName = $this->getSourceModule()->getName();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (\in_array($moduleName, ['HelpDesk', 'Faq'])) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return true;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $this->relations;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'excluded_ids', 'search_params', 'search_key', 'page', 'operator',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public static function getSupportedModules()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (empty(self::$supportedModules)) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return 'ModComments' !== $this->getSourceModule()->getName();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $blocksEliminatedArray = ['HelpDesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    return false;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $this->getSourceModule()->getEntityInstance();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $sourceModule = \App\Module::getModuleId($sourceModule);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $treeList;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $restrictedModules = ['Integration', 'Dashboard'];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $treeList = [];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        while ($row = $dataReader->read()) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string|null $moduleName

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $this->getId()])

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Line exceeds 120 characters; contains 220 characters
                Open

                            'source_module', 'viewname', 'sortorder', 'orderby', 'inventory', 'private', 'src_record', 'relationid', 'relation_id', 'picklist', 'overwritten_shownerid', 'relationoperation', 'sourcemodule', 'sourcerecord'

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        ]);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            self::$supportedModules = self::getEntityModulesList();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->createCommand()->queryAllByGroup();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'Faq' => ['LBL_COMMENT_INFORMATION'],

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Get relations types.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'ADD' => 'PLL_ADD',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        ];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function checkIfPicklistFieldNameReserved(string $fieldName): bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($systemFields as $name => $field) {

                Line exceeds 120 characters; contains 127 characters
                Open

                                $missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['name']);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return void

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $blockModel = Vtiger_Block_Model::getInstance($blockId, $this->getSourceModule()->getName());

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $relatedReferenceFields = (new \App\Db\Query())

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            ->from('vtiger_field')

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Update related view type.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $fieldName

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['name']);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $referenceFieldModels;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string[] $type

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Get missing system fields.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        unset($systemFields['share_externally']);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if ($params) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function getFieldsForWebserviceApps(int $webserviceApp): array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $referenceFieldModels = [];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                ['uitype' => 321],

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        \App\Relation::clearCacheById($relationId);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Loading the list of multireference fields related with module.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach ($relatedReferenceFields as $fieldId) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param int      $relationId

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            ]);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        \App\Db::getInstance()->createCommand()->update('vtiger_relatedlists', ['view_type' => implode(',', $type)], ['relation_id' => $relationId])->execute();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $systemFields = \App\Field::SYSTEM_FIELDS;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $validationConditions = $field['validationConditions'];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            } else {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            continue 2;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $status = true;

                Line exceeds 120 characters; contains 138 characters
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if ($this->checkFieldNameExists($fieldModel->get('name'))) {

                Line exceeds 120 characters; contains 138 characters
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $referenceFieldModels[] = $fieldModel;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $sysName

                Line exceeds 120 characters; contains 132 characters
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if ('OSSMailView' === $moduleName) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public static function getRelationsActions()

                Line exceeds 120 characters; contains 160 characters
                Open

                        \App\Db::getInstance()->createCommand()->update('vtiger_relatedlists', ['view_type' => implode(',', $type)], ['relation_id' => $relationId])->execute();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $name = 'share_externally_' . $id;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                'column' => $name,

                Line exceeds 120 characters; contains 125 characters
                Open

                                'label' => $field['name'] . ' (' . \App\Language::translate($field['type'], 'Settings:WebserviceApps') . ')',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                'fieldparams' => $id,

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    $exist = !$status;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                unset($field['validationConditions']);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $missingFields;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Create system field.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public static function getRelationsTypes(?string $moduleName = null): array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return $types;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Line exceeds 120 characters; contains 199 characters
                Open

                        ) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $systemFields[$name] = array_merge($systemFields['share_externally'], [

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if ($validationConditions === ['name']) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        }

                Line exceeds 120 characters; contains 138 characters
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);

                Line exceeds 120 characters; contains 171 characters
                Open

                        return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $types['getRecordToMails'] = 'PLL_RECORD_TO_MAILS';

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $exist = isset($fields[$name]);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $exist = true;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                        if ($fieldModel->get($validationCondition) == $field[$validationCondition]) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function addSystemField(string $sysName, int $blockId, array $params = []): void

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if ($this->checkFieldLabelExists($fieldModel->get('name'))) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $blockModel->addField($fieldModel);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Get fields for webservice apps.

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param int $webserviceApp

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return [

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param array  $params

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            foreach ($params as $key => $value) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $types = self::TYPES;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return \Vtiger_Field_Model[]

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        foreach (Settings_WebserviceApps_Module_Model::getServers() as $id => $field) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $fieldModel = $missingSystemFields[$sysName];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                $fieldModel->set($key, $value);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $sourceModule Source module name

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return Vtiger_Field_Model[]

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public static function getMultiReferenceFieldsRelatedWithModule(string $moduleName): array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            && !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if (!$exist) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $missingSystemFields = $this->getMissingSystemFields();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if ($this->checkFieldNameCharacters($fieldModel->get('name'))) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            'SELECT' => 'PLL_SELECT',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                foreach ($validationConditions as $validationCondition) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                            $status = false;

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param string $moduleName

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public static function updateRelatedViewType($relationId, $type)

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @return bool

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        ) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    public function getMissingSystemFields(): array

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $fields = $this->getFields();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        $missingFields = [];

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                'label' => $field['name'] . ' (' . \App\Language::translate($field['type'], 'Settings:WebserviceApps') . ')',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * @param int    $blockId

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        if (empty($missingSystemFields[$sysName])) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            ->select(['fieldid'])

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            if ($fieldModel->isActiveField()) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                    /**

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     * Check if picklist field can have that name.

                Line exceeds 120 characters; contains 143 characters
                Open

                            && !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists()

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                'name' => $name,

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                ['like', 'fieldparams', '{"module":"' . $moduleName . '"%', false]

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            ])->column();

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        }

                Spaces must be used to indent lines; tabs are not allowed
                Open

                        return (

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            \App\Fields\Picklist::isPicklistExist($fieldName)

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     */

                Spaces must be used to indent lines; tabs are not allowed
                Open

                                    foreach ($fields as $fieldModel) {

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                     *

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            ->where(['and',

                Spaces must be used to indent lines; tabs are not allowed
                Open

                            $fieldModel = Vtiger_Field_Model::getInstanceFromFieldId($fieldId);

                Class name "Settings_LayoutEditor_Module_Model" is not in camel caps format
                Open

                class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model

                There are no issues that match your filters.

                Category
                Status