YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
B
5 hrs
Test Coverage
F
0%

Method getDetailViewLinks has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getDetailViewLinks(array $linkParams): array
    {
        $currentUserModel = \App\User::getCurrentUserModel();
        $recordModel = $this->getRecord();
        $recordId = $recordModel->getId();
Severity: Major
Found in modules/Users/models/DetailView.php - About 3 hrs to fix

    Function getDetailViewLinks has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getDetailViewLinks(array $linkParams): array
        {
            $currentUserModel = \App\User::getCurrentUserModel();
            $recordModel = $this->getRecord();
            $recordId = $recordModel->getId();
    Severity: Minor
    Found in modules/Users/models/DetailView.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    The method getDetailViewLinks() has an NPath complexity of 643. The configured NPath complexity threshold is 200.
    Open

        public function getDetailViewLinks(array $linkParams): array
        {
            $currentUserModel = \App\User::getCurrentUserModel();
            $recordModel = $this->getRecord();
            $recordId = $recordModel->getId();
    Severity: Minor
    Found in modules/Users/models/DetailView.php by phpmd

    NPathComplexity

    Since: 0.1

    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

    Example

    class Foo {
        function bar() {
            // lots of complicated code
        }
    }

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

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

        public function getDetailViewLinks(array $linkParams): array
        {
            $currentUserModel = \App\User::getCurrentUserModel();
            $recordModel = $this->getRecord();
            $recordId = $recordModel->getId();
    Severity: Minor
    Found in modules/Users/models/DetailView.php by phpmd

    CyclomaticComplexity

    Since: 0.1

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

    Example

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

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

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

        public function getDetailViewLinks(array $linkParams): array
    Severity: Critical
    Found in modules/Users/models/DetailView.php by sonar-php

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

    See

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

                    $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
    Severity: Minor
    Found in modules/Users/models/DetailView.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 '$linkModelList' which will lead to PHP notices.
    Open

            return $linkModelList;
    Severity: Minor
    Found in modules/Users/models/DetailView.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 '$linkModelList' which will lead to PHP notices.
    Open

                    $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
    Severity: Minor
    Found in modules/Users/models/DetailView.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 '$linkModelList' which will lead to PHP notices.
    Open

                    $linkModelList['DETAILVIEWPREFERENCE'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
    Severity: Minor
    Found in modules/Users/models/DetailView.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 '$linkModelList' which will lead to PHP notices.
    Open

            $linkModelList['DETAIL_VIEW_BASIC'] = [];
    Severity: Minor
    Found in modules/Users/models/DetailView.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 'Vtiger_Link_Model' in method 'getDetailViewLinks'.
    Open

                    $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
    Severity: Minor
    Found in modules/Users/models/DetailView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\User' in method 'getDetailViewLinks'.
    Open

                 && $recordModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
    Severity: Minor
    Found in modules/Users/models/DetailView.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 'getDetailViewLinks'.
    Open

                    $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
    Severity: Minor
    Found in modules/Users/models/DetailView.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 'getDetailViewLinks'.
    Open

                    $linkModelList['DETAILVIEWPREFERENCE'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
    Severity: Minor
    Found in modules/Users/models/DetailView.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 'getDetailViewLinks'.
    Open

                if ($currentUserModel->getId() === $recordId && $currentUserModel->get('leader') && \App\Privilege::isPermitted('Users', 'LeaderCanManageGroupMembership')) {
    Severity: Minor
    Found in modules/Users/models/DetailView.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 'getDetailViewLinks'.
    Open

                 && $recordModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
    Severity: Minor
    Found in modules/Users/models/DetailView.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\User' in method 'getDetailViewLinks'.
    Open

            $currentUserModel = \App\User::getCurrentUserModel();
    Severity: Minor
    Found in modules/Users/models/DetailView.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 "linkurl" 3 times.
    Open

                    'linkurl' => 'PreferenceDetail' === $linkParams['VIEW'] ? $recordModel->getPreferenceEditViewUrl() : $recordModel->getEditViewUrl(),
    Severity: Critical
    Found in modules/Users/models/DetailView.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 "linkdata" 4 times.
    Open

                    'linkdata' => ['url' => 'index.php?module=Users&view=PasswordModal&mode=change&record=' . $recordId],
    Severity: Critical
    Found in modules/Users/models/DetailView.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 "linkclass" 6 times.
    Open

                    'linkclass' => 'btn-outline-info showModal',
    Severity: Critical
    Found in modules/Users/models/DetailView.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 "DETAIL_VIEW_ADDITIONAL" 5 times.
    Open

                    'linktype' => 'DETAIL_VIEW_ADDITIONAL',
    Severity: Critical
    Found in modules/Users/models/DetailView.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" 7 times.
    Open

                    'linkicon' => 'fas fa-key mr-1',
    Severity: Critical
    Found in modules/Users/models/DetailView.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 "linklabel" 7 times.
    Open

                    'linklabel' => 'LBL_CHANGE_PASSWORD',
    Severity: Critical
    Found in modules/Users/models/DetailView.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" 8 times.
    Open

                    'linktype' => 'DETAIL_VIEW_ADDITIONAL',
    Severity: Critical
    Found in modules/Users/models/DetailView.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 "showLabel" 7 times.
    Open

                    'showLabel' => true,
    Severity: Critical
    Found in modules/Users/models/DetailView.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 "DETAIL_VIEW_BASIC" 5 times.
    Open

            $linkModelList['DETAIL_VIEW_BASIC'] = [];
    Severity: Critical
    Found in modules/Users/models/DetailView.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.

    Class extends undeclared class \Vtiger_DetailView_Model
    Open

    class Users_DetailView_Model extends Vtiger_DetailView_Model
    Severity: Critical
    Found in modules/Users/models/DetailView.php by phan

    Call to undeclared method \Users_DetailView_Model::getRecord
    Open

            $recordModel = $this->getRecord();
    Severity: Critical
    Found in modules/Users/models/DetailView.php by phan

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

                 && $recordModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
    Severity: Critical
    Found in modules/Users/models/DetailView.php by phan

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

            $linkModelList['DETAIL_VIEW_BASIC'] = [];
    Severity: Info
    Found in modules/Users/models/DetailView.php by phan

    Call to undeclared method \Users_DetailView_Model::getRecord
    Open

                $recordModel = $this->getRecord();
    Severity: Critical
    Found in modules/Users/models/DetailView.php by phan

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

            $currentUserModel = \App\User::getCurrentUserModel();
    Severity: Critical
    Found in modules/Users/models/DetailView.php by phan

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

                $detailViewActionLinks = [];
    Severity: Minor
    Found in modules/Users/models/DetailView.php by phpmd

    LongVariable

    Since: 0.2

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

    Example

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

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

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

    class Users_DetailView_Model extends Vtiger_DetailView_Model

    The class Users_DetailView_Model is not named in CamelCase.
    Open

    class Users_DetailView_Model extends Vtiger_DetailView_Model
    {
        /** {@inheritdoc} */
        public function getDetailViewLinks(array $linkParams): array
        {
    Severity: Minor
    Found in modules/Users/models/DetailView.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

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

                ) {

    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

            if (($currentUserModel->isAdmin() || $currentUserModel->getId() === $recordId) && 'Active' === $recordModel->get('status')) {

    Line exceeds 120 characters; contains 148 characters
    Open

                    'linkurl' => 'PreferenceDetail' === $linkParams['VIEW'] ? $recordModel->getPreferenceEditViewUrl() : $recordModel->getEditViewUrl(),

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

                 && $recordModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')

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

                        'linkdata' => ['url' => 'index.php?module=Users&view=TwoFactorAuthenticationModal&record=' . $recordId],

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

                    'linkclass' => 'btn-outline-info showModal',

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

                        'showLabel' => true,

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

                    'linklabel' => 'LBL_EDIT',

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

                    $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);

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

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

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

                        'linkurl' => 'javascript:Users_Detail_Js.triggerDeleteUser("' . $recordModel->getDeleteUrl() . '")',

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

                        'linkclass' => 'btn-outline-danger',

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

                        'showLabel' => true,

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

                foreach ($detailViewLinks as $detailViewLink) {

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

                    $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);

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

                }

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

                $recordModel = $this->getRecord();

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

                $detailViewActionLinks = [];

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

                    $detailViewLinks[] = [

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

                        'linkclass' => 'showModal',

    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-outline-info showModal',

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

            }

    Line exceeds 120 characters; contains 163 characters
    Open

                    'linkurl' => "javascript:Users_Detail_Js.triggerChangeAccessKey('index.php?module=Users&action=SaveAjax&mode=changeAccessKey&record={$recordId}')",

    Line exceeds 120 characters; contains 133 characters
    Open

            if (($currentUserModel->isAdmin() || $currentUserModel->getId() === $recordId) && 'Active' === $recordModel->get('status')) {

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

                if ($currentUserModel->isAdmin()) {

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

                    'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                        'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                $detailViewActionLinks[] = [

    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

                if ($currentUserModel->getId() === $recordId && $currentUserModel->get('leader') && \App\Privilege::isPermitted('Users', 'LeaderCanManageGroupMembership')) {

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

                    $detailViewActionLinks[] = [

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

                foreach ($detailViewActionLinks as $detailViewLink) {

    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

                    'showLabel' => true,

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

                    ('PLL_PASSWORD_2FA' === $recordModel->get('login_method') || 'PLL_LDAP_2FA' === $recordModel->get('login_method'))

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

                    'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

            $recordId = $recordModel->getId();

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

                }

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

                        'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                if ($currentUserModel->getId() !== $recordId) {

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

                    'showLabel' => true,

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

                        'linktype' => 'DETAIL_VIEW_BASIC',

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

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

                    'linkurl' => "javascript:Users_Detail_Js.triggerChangeAccessKey('index.php?module=Users&action=SaveAjax&mode=changeAccessKey&record={$recordId}')",

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

                        'linklabel' => 'LBL_2FA_TOTP_QR_CODE',

    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

                    'linkurl' => 'PreferenceDetail' === $linkParams['VIEW'] ? $recordModel->getPreferenceEditViewUrl() : $recordModel->getEditViewUrl(),

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

                    'linkclass' => 'btn-outline-success',

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

                }

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

                    $linkModelList['DETAILVIEWPREFERENCE'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);

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

                    'linktype' => 'DETAIL_VIEW_BASIC',

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

                ];

    Line exceeds 120 characters; contains 134 characters
    Open

                 && $recordModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')

    Line exceeds 120 characters; contains 124 characters
    Open

                        'linkdata' => ['url' => 'index.php?module=Users&view=TwoFactorAuthenticationModal&record=' . $recordId],

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

                    ];

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

            $currentUserModel = \App\User::getCurrentUserModel();

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

            $linkModelList['DETAIL_VIEW_BASIC'] = [];

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

                    'showLabel' => true,

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

                        'linkdata' => ['url' => 'index.php?module=Users&view=Groups&record=' . $recordId],

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

                        'linklabel' => 'BTN_RESET_PASSWORD',

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

                        'linklabel' => 'LBL_DELETE',

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

            return $linkModelList;

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

                if (

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

        public function getDetailViewLinks(array $linkParams): array

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

                $detailViewLinks[] = [

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

                    'linkdata' => ['url' => 'index.php?module=Users&view=PasswordModal&mode=change&record=' . $recordId],

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

                        'linkicon' => 'fas fa-trash-alt mr-1',

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

                    'linklabel' => 'LBL_CHANGE_ACCESS_KEY',

    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

                        'linktype' => 'DETAIL_VIEW_BASIC',

    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' => 'js-show-modal',

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

                        'linkicon' => 'yfi-groups',

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

                    ];

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

                    $detailViewLinks[] = [

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

                    $detailViewLink['linktype'] = 'DETAILVIEWPREFERENCE';

    Line exceeds 120 characters; contains 169 characters
    Open

                if ($currentUserModel->getId() === $recordId && $currentUserModel->get('leader') && \App\Privilege::isPermitted('Users', 'LeaderCanManageGroupMembership')) {

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

            $recordModel = $this->getRecord();

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

                $detailViewLinks = [];

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

                    'linklabel' => 'LBL_CHANGE_PASSWORD',

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

                    'linkicon' => 'fas fa-key mr-1',

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

                        'linkdata' => ['url' => 'index.php?module=Users&view=PasswordModal&mode=reset&record=' . $recordId],

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

                        'showLabel' => true,

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

                $detailViewLinks[] = [

    Line exceeds 120 characters; contains 130 characters
    Open

                    ('PLL_PASSWORD_2FA' === $recordModel->get('login_method') || 'PLL_LDAP_2FA' === $recordModel->get('login_method'))

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

                    $detailViewActionLinks[] = [

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

                        'linklabel' => 'LBL_GROUP_MEMBERS_CHANGE_VIEW',

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

    class Users_DetailView_Model extends Vtiger_DetailView_Model

    Expected 0 spaces after opening bracket; newline found
    Open

                if (

    There are no issues that match your filters.

    Category
    Status