YetiForceCompany/YetiForceCRM

View on GitHub
modules/Users/models/ListView.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

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

    public function getListViewMassActions($linkParams)
    {
        $links['LISTVIEWMASSACTION'] = [];
        $massActionLinks = [];
        if ('Users' === $linkParams['MODULE'] && 'List' === $linkParams['ACTION'] && App\User::getCurrentUserModel()->isAdmin()) {
Severity: Minor
Found in modules/Users/models/ListView.php - About 1 hr to fix

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

        public function getListViewHeaders()
        {
            $headerFieldModels = [];
            $headerFields = $this->getQueryGenerator()->getListViewFields();
            foreach ($headerFields as $fieldName => &$fieldsModel) {
    Severity: Minor
    Found in modules/Users/models/ListView.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

    Avoid using undefined variables such as '$links' which will lead to PHP notices.
    Open

            return $links;
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

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

    Avoid using undefined variables such as '$links' which will lead to PHP notices.
    Open

                $links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

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

    Avoid using undefined variables such as '$links' which will lead to PHP notices.
    Open

            $links['LISTVIEWMASSACTION'] = [];
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

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

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

            $createPermission = \App\Privilege::isPermitted($moduleModel->getName(), 'CreateView');
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewLinks'.
    Open

                $links['LISTVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($advancedLink);
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewLinks'.
    Open

            $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), $linkTypes, $linkParams);
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                if ('TOTP_OFF' !== App\Config::security('USER_AUTHY_MODE')) {
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewMassActions'.
    Open

                $links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewLinks'.
    Open

                $links['LISTVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
                    'linktype' => 'LISTVIEWBASIC',
                    'linklabel' => 'LBL_ADD_RECORD',
                    'linkurl' => $this->getModule()->getCreateRecordUrl(),
                    'linkicon' => '',
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            $importPermission = \App\Privilege::isPermitted($moduleModel->getName(), 'Import');
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                    'linklabel' => 'LBL_ADD_RECORD',
    Severity: Critical
    Found in modules/Users/models/ListView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

                    'linkurl' => $this->getModule()->getCreateRecordUrl(),
    Severity: Critical
    Found in modules/Users/models/ListView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $links['LISTVIEWMASSACTION'] = [];
    Severity: Critical
    Found in modules/Users/models/ListView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

                    'linktype' => 'LISTVIEWBASIC',
    Severity: Critical
    Found in modules/Users/models/ListView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $linkTypes = ['LISTVIEWBASIC', 'LISTVIEW', 'LISTVIEWSETTING'];
    Severity: Critical
    Found in modules/Users/models/ListView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

                    'linkicon' => '',
    Severity: Critical
    Found in modules/Users/models/ListView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $linkTypes = ['LISTVIEWBASIC', 'LISTVIEW', 'LISTVIEWSETTING'];
    Severity: Critical
    Found in modules/Users/models/ListView.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Saw unextractable annotation for comment '* @param <array> $linkParams'</array>
    Open

         * @param <Array> $linkParams
    Severity: Info
    Found in modules/Users/models/ListView.php by phan

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

            if ('Users' === $linkParams['MODULE'] && 'List' === $linkParams['ACTION'] && App\User::getCurrentUserModel()->isAdmin()) {
    Severity: Critical
    Found in modules/Users/models/ListView.php by phan

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

            $fields = $queryGenerator->getFields();
    Severity: Critical
    Found in modules/Users/models/ListView.php by phan

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

                    return $this->getQueryGenerator()->setRelatedOrder([
    Severity: Critical
    Found in modules/Users/models/ListView.php by phan

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

            if (App\User::getCurrentUserModel()->isAdmin()) {
    Severity: Critical
    Found in modules/Users/models/ListView.php by phan

    Saw unextractable annotation for comment '* @param <array> $linkParams'</array>
    Open

         * @param <Array> $linkParams
    Severity: Info
    Found in modules/Users/models/ListView.php by phan

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

                return $this->getQueryGenerator()->setOrder($orderBy, $this->getForSql('sortorder'));
    Severity: Critical
    Found in modules/Users/models/ListView.php by phan

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

            $headerFields = $this->getQueryGenerator()->getListViewFields();
    Severity: Critical
    Found in modules/Users/models/ListView.php by phan

    Saw unextractable annotation for comment '* @return <array> - Associate array of Link Type to List of Vtiger_Link_Model instances'</array>
    Open

         * @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances
    Severity: Info
    Found in modules/Users/models/ListView.php by phan

    Saw unextractable annotation for comment '* @return <array> - Associative array of Link type to List of Vtiger_Link_Model instances for Mass Actions'</array>
    Open

         * @return <Array> - Associative array of Link type to List of  Vtiger_Link_Model instances for Mass Actions
    Severity: Info
    Found in modules/Users/models/ListView.php by phan

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

            $links['LISTVIEWMASSACTION'] = [];
    Severity: Info
    Found in modules/Users/models/ListView.php by phan

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

            $queryGenerator->setFields($fields);
    Severity: Critical
    Found in modules/Users/models/ListView.php by phan

    Argument 1 (moduleName) is false but \App\Privilege::isPermitted() takes string defined at /code/app/Privilege.php:48
    Open

            $importPermission = \App\Privilege::isPermitted($moduleModel->getName(), 'Import');
    Severity: Minor
    Found in modules/Users/models/ListView.php by phan

    Argument 1 (moduleName) is false but \App\Privilege::isPermitted() takes string defined at /code/app/Privilege.php:48
    Open

            $createPermission = \App\Privilege::isPermitted($moduleModel->getName(), 'CreateView');
    Severity: Minor
    Found in modules/Users/models/ListView.php by phan

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

    class Users_ListView_Model extends Vtiger_ListView_Model

    The class Users_ListView_Model is not named in CamelCase.
    Open

    class Users_ListView_Model extends Vtiger_ListView_Model
    {
        /**
         * Function to get the list of listview links for the module.
         *
    Severity: Minor
    Found in modules/Users/models/ListView.php by phpmd

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

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

         * @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances

    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

            $fields[] = 'authy_secret_totp';

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

        public function getListViewLinks($linkParams)

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

                    'linkurl' => $this->getModule()->getCreateRecordUrl(),

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

            }

    Line exceeds 120 characters; contains 142 characters
    Open

                    'linkurl' => 'javascript:Vtiger_List_Js.triggerMassEdit("index.php?module=Users&view=MassActionAjax&mode=showMassEditForm");',

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

                $massActionLinks[] = [

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

                        'linkicon' => 'fas fa-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

            if (App\User::getCurrentUserModel()->isAdmin()) {

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

         * Function to get the list of Mass actions for the module.

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

                    'linktype' => 'LISTVIEWMASSACTION',

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

            $advancedLinks = $this->getAdvancedLinks();

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

         * @param <Array> $linkParams

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

         * @return <Array> - Associative array of Link type to List of  Vtiger_Link_Model instances for Mass Actions

    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

            $fields[] = 'imagename';

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

            $queryGenerator->setFields($fields);

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

         * Function to get the list view header.

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

                    continue;

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

                $headerFieldModels[$fieldName] = $fieldsModel;

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

            $createPermission = \App\Privilege::isPermitted($moduleModel->getName(), 'CreateView');

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

            $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), $linkTypes, $linkParams);

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

                    'linkclass' => 'btn-light',

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

        }

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

            $links['LISTVIEWMASSACTION'] = [];

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

                $massActionLinks[] = [

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

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

                    'linktype' => 'LISTVIEW',

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

         * @param <Array> $linkParams

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

                    'linklabel' => 'LBL_ADD_RECORD',

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

         *

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

            if ('Users' === $linkParams['MODULE'] && 'List' === $linkParams['ACTION'] && App\User::getCurrentUserModel()->isAdmin()) {

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

         * Function to get the list of listview links for the module.

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

                $links['LISTVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues([

    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 getListViewMassActions($linkParams)

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

                    'linkicon' => 'fas fa-redo-alt',

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

            foreach ($massActionLinks as $massActionLink) {

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

                $links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);

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

            // Added as Users module do not have custom filters and id column is added by querygenerator.

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

            $fields = $queryGenerator->getFields();

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

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

            $moduleModel = $this->getModule();

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

        /**

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

         * @return Vtiger_Field_Model[] - List of Vtiger_Field_Model instances

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

                if ($fieldsModel && ((!$fieldsModel->isViewable() && 106 !== $fieldsModel->getUitype()) || !$fieldsModel->getPermissions())) {

    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

                    'linktype' => 'LISTVIEWMASSACTION',

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

            $headerFieldModels = [];

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

            foreach ($headerFields as $fieldName => &$fieldsModel) {

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

         * @return array of advanced links

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

            $linkTypes = ['LISTVIEWBASIC', 'LISTVIEW', 'LISTVIEWSETTING'];

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

                if ('TOTP_OFF' !== App\Config::security('USER_AUTHY_MODE')) {

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

                        'linkurl' => 'javascript:Settings_Users_List_Js.triggerMassOff2FA()',

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

         * Function to give advance links of Users module.

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

                        'linktype' => 'LISTVIEWMASSACTION',

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

            $queryGenerator = $this->getQueryGenerator();

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

        public function getListViewHeaders()

    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

            $importPermission = \App\Privilege::isPermitted($moduleModel->getName(), 'Import');

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

                $links['LISTVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($advancedLink);

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

            $massActionLinks = [];

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

                    'linkurl' => 'javascript:Vtiger_List_Js.triggerMassEdit("index.php?module=Users&view=MassActionAjax&mode=showMassEditForm");',

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

                    'linkurl' => 'index.php?module=Users&view=PasswordModal&mode=massReset',

    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

                        'linklabel' => 'BTN_MASS_OFF_2FA',

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

        public function getListViewEntries(Vtiger_Paging_Model $pagingModel)

    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

            $headerFields = $this->getQueryGenerator()->getListViewFields();

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

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

            return $links;

    Line exceeds 120 characters; contains 130 characters
    Open

            if ('Users' === $linkParams['MODULE'] && 'List' === $linkParams['ACTION'] && App\User::getCurrentUserModel()->isAdmin()) {

    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 ($importPermission && $createPermission) {

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

                $advancedLinks[] = [

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

                    'linktype' => 'LISTVIEWBASIC',

    Line exceeds 120 characters; contains 138 characters
    Open

                if ($fieldsModel && ((!$fieldsModel->isViewable() && 106 !== $fieldsModel->getUitype()) || !$fieldsModel->getPermissions())) {

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

        public function getAdvancedLinks()

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

                    'linklabel' => 'LBL_EXPORT',

    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 ($advancedLinks as $advancedLink) {

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

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

            return parent::getListViewEntries($pagingModel);

    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

            $advancedLinks = [];

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

                        'relatedModule' => $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

                    'linklabel' => 'LBL_MASS_EDIT',

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

                    'linklabel' => 'BTN_MASS_RESET_PASSWORD',

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

                    $massActionLinks[] = [

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

        }

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

                $advancedLinks[] = [

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

                    'linktype' => 'LISTVIEW',

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

                    'linkurl' => 'javascript:Vtiger_List_Js.triggerExportAction("' . $moduleModel->getExportUrl() . '")',

    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

            $orderBy = $this->getForSql('orderby');

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

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

                    'linkicon' => 'fas fa-upload',

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

            }

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

                        'relatedSortOrder' => $this->getForSql('sortorder'),

    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' => 'fas fa-download',

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

                return $this->getQueryGenerator()->setOrder($orderBy, $this->getForSql('sortorder'));

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

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

                        'sourceField' => $sourceFieldName,

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

                    'linklabel' => 'LBL_IMPORT',

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

                [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $orderBy), 3, false);

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

                    return $this->getQueryGenerator()->setRelatedOrder([

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

                        'relatedField' => $fieldName,

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

            if (!empty($orderBy)) {

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

                    'linkurl' => $moduleModel->getImportUrl(),

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

        public function loadListViewOrderBy()

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

    class Users_ListView_Model extends Vtiger_ListView_Model

    There are no issues that match your filters.

    Category
    Status