YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
B
5 hrs
Test Coverage
F
0%

Method getFieldInstanceByName has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name, $edit = false)
    {
        if (!isset($this->fields[$name])) {
            $moduleName = $this->getName(true);
            $params = ['column' => $name, 'name' => $name, 'label' => $this->listFields[$name] ?? '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255', 'sort' => true];
Severity: Major
Found in modules/Settings/AdminAccess/models/Module.php - About 2 hrs to fix

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

        public function getFieldInstanceByName($name, $edit = false)
        {
            if (!isset($this->fields[$name])) {
                $moduleName = $this->getName(true);
                $params = ['column' => $name, 'name' => $name, 'label' => $this->listFields[$name] ?? '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255', 'sort' => true];
    Severity: Minor
    Found in modules/Settings/AdminAccess/models/Module.php - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        public function getValueFromRequest(string $fieldName, App\Request $request)
        {
            switch ($fieldName) {
                case 'name':
                    $value = $request->getArray($fieldName, \App\Purifier::ALNUM);
    Severity: Minor
    Found in modules/Settings/AdminAccess/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 getDisplayValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getDisplayValue(string $key, $value)
        {
            switch ($key) {
                case 'name':
                    $value = \App\Language::translate($value, "Settings:{$value}");
    Severity: Minor
    Found in modules/Settings/AdminAccess/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 getFieldInstanceByName() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
    Open

        public function getFieldInstanceByName($name, $edit = false)
        {
            if (!isset($this->fields[$name])) {
                $moduleName = $this->getName(true);
                $params = ['column' => $name, 'name' => $name, 'label' => $this->listFields[$name] ?? '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255', 'sort' => true];

    CyclomaticComplexity

    Since: 0.1

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

    Example

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

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

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

        public function getFieldInstanceByName($name, $edit = false)

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

    See

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

        public function getFieldInstanceByName($name, $edit = 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

    Missing class import via use statement (line '133', column '48').
    Open

                        $users = $edit ? $this->getUsers() : (new \App\Db\Query())->from($params['table'])->select([$name])->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 '158', column '20').
    Open

                        $users = (new \App\Db\Query())->from($params['table'])->select([$name])->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 '210', column '15').
    Open

            return (new \App\QueryGenerator('Users'))->setFields(['id'])

    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 '117', column '22').
    Open

                        $modules = (new \App\Db\Query())->from($this->getBaseTable())->select(['name'])->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

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

                            $params['picklistValues'][$userId] = \App\Fields\Owner::getUserLabel($userId);

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

                    $value = \App\Language::translate(1 == $value ? 'LBL_YES' : 'LBL_NO', $this->getName(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\Fields\Owner' in method 'getDisplayValue'.
    Open

                    $value = \App\Fields\Owner::getLabel($value);

    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_Link_Model' in method 'getLinks'.
    Open

            return [Vtiger_Link_Model::getInstanceFromValues([
                'linktype' => 'LISTVIEWBASIC',
                'linklabel' => 'BTN_MASS_EDIT_ACCESS',
                'linkdata' => ['url' => $this->getEditViewUrl()],
                'linkicon' => 'yfi yfi-full-editing-view',

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

                    $value = \App\Purifier::encodeHtml($value);

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

                $fields[$key] = \Vtiger_Field_Model::init($moduleName, $value, $key);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                            $params['picklistValues'][$userId] = \App\Fields\Owner::getUserLabel($userId);

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

                            $params['picklistValues'][$module] = \App\Language::translate($module, "Settings:{$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

    Avoid using static access to class '\Vtiger_Field_Model' in method 'getFieldInstanceByName'.
    Open

                $this->fields[$name] = \Vtiger_Field_Model::init($moduleName, $params, $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

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

                    $value = \App\Language::translate($value, "Settings:{$value}");

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'App\Config' in method 'getFields'.
    Open

            $config = App\Config::security();

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

            'status' => 'FL_ACTIVE'

    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

                        $params['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 "typeofdata" 6 times.
    Open

                $params = ['column' => $name, 'name' => $name, 'label' => $this->listFields[$name] ?? '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255', 'sort' => true];

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

                    case 'userid':

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

                    case 'purpose':

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

                    'uitype' => 56,

    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 "l_#__users_login_purpose" 3 times.
    Open

                        $params['table'] = 'l_#__users_login_purpose';

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

                    case 'baseid':

    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 "table" 8 times.
    Open

                        $params['table'] = $this->getBaseTable();

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

                    case 'datetime':

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

                    'label' => 'LBL_LOGIN_ADMIN_VISIT_PURPOSE',

    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.

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

            return (new \App\QueryGenerator('Users'))->setFields(['id'])

    Reference to undeclared property \Settings_AdminAccess_Module_Model->fields
    Open

            if (!isset($this->fields[$name])) {

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

                        $users = (new \App\Db\Query())->from($params['table'])->select([$name])->column();

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

                        $modules = (new \App\Db\Query())->from($this->getBaseTable())->select(['name'])->column();

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

            return (new \App\QueryGenerator('Users'))->setFields(['id'])

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

                            $params['picklistValues'][$userId] = \App\Fields\Owner::getUserLabel($userId);

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

                            $params['picklistValues'][$userId] = \App\Fields\Owner::getUserLabel($userId);

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

                    $value = \App\Fields\Owner::getLabel($value);

    Reference to undeclared property \Settings_AdminAccess_Module_Model->fields
    Open

            return $this->fields[$name];

    Doc-block of $id in getEditViewUrl is phpdoc param type int which is not a permitted replacement of the nullable param type ?int declared in the signature ('?T' should be documented as 'T|null' or '?T')
    Open

         * @param int $id

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

                        $users = $edit ? $this->getUsers() : (new \App\Db\Query())->from($params['table'])->select([$name])->column();

    Reference to undeclared property \Settings_AdminAccess_Module_Model->fields
    Open

                $this->fields[$name] = \Vtiger_Field_Model::init($moduleName, $params, $name);

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

    class Settings_AdminAccess_Module_Model extends Settings_Vtiger_Module_Model

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

        public function getEditViewUrl(int $id = null): string

    ShortVariable

    Since: 0.2

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

    Example

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

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

    The class Settings_AdminAccess_Module_Model is not named in CamelCase.
    Open

    class Settings_AdminAccess_Module_Model extends Settings_Vtiger_Module_Model
    {
        /** {@inheritdoc} */
        public $name = 'AdminAccess';
    
    

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    Terminating statement must be on a line by itself
    Open

                    default: break;

    The DEFAULT body must start on the line following the statement
    Open

                    default: break;

    The DEFAULT body must start on the line following the statement
    Open

                default: break;

    The DEFAULT body must start on the line following the statement
    Open

                default: break;

    Terminating statement must be on a line by itself
    Open

                default: break;

    Terminating statement must be on a line by itself
    Open

                default: break;

    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

            foreach (array_keys($this->listFields) as $fieldName) {

    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

        public $listFields = [

    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 $baseTable = 'a_#__settings_modules';

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

        public $baseIndex = '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

            return $fields;

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

            'status' => 'FL_ACTIVE'

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

         * Function returns list of fields available in edit view.

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

         */

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

            'user' => 'FL_USER',

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

                $fields[$fieldName] = $this->getFieldInstanceByName($fieldName);

    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

        /** {@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

         * @param string $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

                    case 'status':

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

                        $params['label'] = 'FL_PURPOSE';

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

            return $this->fields[$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

                    $value = $request->getArray($fieldName, \App\Purifier::INTEGER);

    Line exceeds 120 characters; contains 160 characters
    Open

                    $value = $this->getFieldInstanceByName($fieldName)->getUITypeModel()->getDbConditionBuilderValue($request->getByType($fieldName, 'Text'), 'bw');

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

            foreach (array_keys($this->listFields) as $fieldName) {

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

         */

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

        public static function getFields(string $moduleName): array

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

                'askAdminAboutVisitPurpose' => [

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

                            $params['picklistValues'][$module] = \App\Language::translate($module, "Settings:{$module}");

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

                        $params['typeofdata'] = 'C~O';

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

                    case 'baseid':

    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 getValueFromRequest(string $fieldName, App\Request $request)

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

                case 'user':

    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

            'name' => 'FL_MODULE_NAME',

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

            $fields = [];

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

                        $params['label'] = 'baseid' === $name ? 'FL_BASE_USER' : 'FL_USER';

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

                        $params['table'] = 'l_#__users_login_purpose';

    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

         * Gets value from request.

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

        /**

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

        public function getFieldsForSave(): 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

                    'fieldvalue' => $config['askAdminAboutVisitPurpose'] ?? ''

    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

            foreach ($fields 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

                        $params['picklistValues'] = [];

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

                        $modules = (new \App\Db\Query())->from($this->getBaseTable())->select(['name'])->column();

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

                $this->fields[$name] = \Vtiger_Field_Model::init($moduleName, $params, $name);

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

         * @return mixed

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

                    break;

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

        public function getListFields(): 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

         * @return \Vtiger_Field_Model

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

                        foreach ($modules as $module) {

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

                case 'status':

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

        public $name = 'AdminAccess';

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

        ];

    Line exceeds 120 characters; contains 236 characters
    Open

                $params = ['column' => $name, 'name' => $name, 'label' => $this->listFields[$name] ?? '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255', 'sort' => true];

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

                        $params['uitype'] = 16;

    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

                        $params['uitype'] = 80;

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

                        $params['label'] = 'FL_DATE_TIME';

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

                        $params['picklistValues'] = [];

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

                }

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

            switch ($fieldName) {

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

                case 'userid':

    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

            $fields = [];

    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

                $moduleName = $this->getName(true);

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

                        $params['table'] = \App\Security\AdminAccess::ACCESS_TABLE_NAME;

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

                        $params['table'] = 'l_#__users_login_purpose';

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

                    case 'purpose':

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

                        $params['typeofdata'] = 'V~O';

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

                        $params['sort'] = 'false';

    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

        /**

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

            $config = App\Config::security();

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

                    'labelDesc' => 'LBL_LOGIN_ADMIN_VISIT_SWITCH_USERS_DESC',

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

                    'fieldvalue' => $config['askAdminAboutVisitSwitchUsers'] ?? ''

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

                    case 'name':

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

                        $params['table'] = $this->getBaseTable();

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

                            $params['picklistValues'][$userId] = \App\Fields\Owner::getUserLabel($userId);

    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

                        $params['table'] = 'l_#__users_login_purpose';

    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

         * @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

            return $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

            if (!isset($this->fields[$name])) {

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

                $params = ['column' => $name, 'name' => $name, 'label' => $this->listFields[$name] ?? '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255', 'sort' => true];

    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

                        $params['typeofdata'] = 'V~O';

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

                        break;

    Line exceeds 120 characters; contains 159 characters
    Open

                    $value = $this->getFieldInstanceByName($fieldName)->getUITypeModel()->getDbConditionBuilderValue($request->getByType($fieldName, 'Text'), 'c');

    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 getEditFields(): 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

                    'purifyType' => 'bool',

    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

                    'labelDesc' => 'LBL_LOGIN_ADMIN_VISIT_PURPOSE_DESC',

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

                    'purifyType' => 'bool',

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

                switch ($name) {

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

                    case 'user':

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

                        $params['uitype'] = 33;

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

                        $params['picklistValues'] = [];

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

                        foreach ($users as $userId) {

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

                        foreach ($users as $userId) {

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

                    default: break;

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

                    $value = $request->getArray($fieldName, \App\Purifier::ALNUM);

    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

                        $params['sort'] = 'false';

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

                        $users = $edit ? $this->getUsers() : (new \App\Db\Query())->from($params['table'])->select([$name])->column();

    Line exceeds 120 characters; contains 130 characters
    Open

                        $users = $edit ? $this->getUsers() : (new \App\Db\Query())->from($params['table'])->select([$name])->column();

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

                        $params['uitype'] = 300;

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

                            $params['picklistValues'][$userId] = \App\Fields\Owner::getUserLabel($userId);

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

         * @param App\Request $request

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

                case 'datetime':

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

                case 'purpose':

    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

                        break;

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

                case 'name':

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

                    break;

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

                    $value = $this->getFieldInstanceByName($fieldName)->getUITypeModel()->getDbConditionBuilderValue($request->getByType($fieldName, 'Text'), 'c');

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

         */

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

                ->addCondition('is_admin', 'on', 'n')->createQuery()->column();

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

            return 'index.php?module=' . $this->getName() . '&parent=Settings&view=Edit' . ($id ? "&id={$id}" : '');

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

        public function getStructure(string $key): array

    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

        /**

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

                    'label' => 'LBL_LOGIN_ADMIN_VISIT_SWITCH_USERS',

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

                $fields[$key] = \Vtiger_Field_Model::init($moduleName, $value, $key);

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

        }

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

         *

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

         * @param bool   $edit

    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 'userid':

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

                        $params['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

                    break;

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

                    $value = $this->getFieldInstanceByName($fieldName)->getUITypeModel()->getDbConditionBuilderValue($request->getByType($fieldName, 'Text'), 'bw');

    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 getLinks(): array

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

                'linklabel' => 'BTN_MASS_EDIT_ACCESS',

    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

         * Edit view URL.

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

         * Function to get the links.

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

        {

    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

                    $value = \App\Language::translate(1 == $value ? 'LBL_YES' : 'LBL_NO', $this->getName(true));

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

                    break;

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

                    }

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

            }

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

         * Function gives list fields for save.

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

         * Get fields for config 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

                'askAdminAboutVisitSwitchUsers' => [

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

         * Gets field instance by name.

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

        public function getFieldInstanceByName($name, $edit = false)

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

                        $params['uitype'] = 56;

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

                        $params['typeofdata'] = 'DT~O';

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

            return $value;

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

        /**

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

         * @param string $key

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

        public function getDisplayValue(string $key, $value)

    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

            return $fields;

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

            return ['user', 'status'];

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

            $fields = [

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

                    'label' => 'LBL_LOGIN_ADMIN_VISIT_PURPOSE',

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

        {

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

                        $params['typeofdata'] = 'V~O';

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

                'linktype' => 'LISTVIEWBASIC',

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

         * Gets display value.

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

                    break;

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

                case 'user':

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

        /**

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

                $fields[$fieldName] = $this->getFieldInstanceByName($fieldName, 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

                        $params['table'] = $this->getBaseTable();

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

                        }

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

                        $users = (new \App\Db\Query())->from($params['table'])->select([$name])->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

                    $value = $request->getInteger($fieldName);

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

                case 'baseid':

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

         * @param int $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

                case 'userid':

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

            return $value;

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

                        $fields[] = $this->getFieldInstanceByName($fieldName);

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

            return $fields;

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

                    break;

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

         *

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

        }

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

        /**

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

         *

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

                'linkicon' => 'yfi yfi-full-editing-view',

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

                    $value = \is_array($value) ? implode(', ', $value) : $value;

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

                    foreach (['userid', 'datetime', 'purpose', 'baseid'] as $fieldName) {

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

        public function getUsers(): 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

                'linkclass' => 'btn-primary js-show-modal',

    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

         * Gets structure.

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

            $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

         * @param string $key

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

        {

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

            return (new \App\QueryGenerator('Users'))->setFields(['id'])

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

        public function getEditViewUrl(int $id = null): string

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

         * @return Vtiger_Link_Model[]

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

            return [Vtiger_Link_Model::getInstanceFromValues([

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

         * @return mixed

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

                case 'baseid':

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

                case 'purpose':

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

         *

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

         */

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

                case 'visitPurpose':

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

                default: break;

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

         * @param mixed  $value

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

                    $value = \App\Fields\Owner::getLabel($value);

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

                default: 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

                'linkdata' => ['url' => $this->getEditViewUrl()],

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

                    $value = $this->getFieldInstanceByName($key)->getUITypeModel()->getListViewDisplayValue($value);

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

                    $value = \App\Purifier::encodeHtml($value);

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

         * Function to get Alphabet Search 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

         */

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

                case 'name':

    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

        public function getAlphabetSearchField()

    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

                'showLabel' => 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

                    $value = \App\Language::translate($value, "Settings:{$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

                    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

         * Gets users.

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

        {

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

        /**

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

                    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

         * @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

                case 'status':

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

        {

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

    class Settings_AdminAccess_Module_Model extends Settings_Vtiger_Module_Model

    Closing brace must be on a line by itself
    Open

                default: break;

    Closing brace must be on a line by itself
    Open

                    default: break;

    Closing brace must be on a line by itself
    Open

                default: break;

    There are no issues that match your filters.

    Category
    Status