YetiForceCompany/YetiForceCRM

View on GitHub
modules/Users/views/PasswordModal.php

Summary

Maintainability
C
7 hrs
Test Coverage
F
0%

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

    public function change(App\Request $request)
    {
        $moduleName = $request->getModule();
        $viewer = $this->getViewer($request);
        $viewer->assign('WARNING', '');
Severity: Minor
Found in modules/Users/views/PasswordModal.php - About 1 hr to fix

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

        public function checkPermission(App\Request $request)
        {
            $currentUserModel = Users_Record_Model::getCurrentUserModel();
            switch ($request->getMode()) {
                case 'reset':
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 change has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function change(App\Request $request)
        {
            $moduleName = $request->getModule();
            $viewer = $this->getViewer($request);
            $viewer->assign('WARNING', '');
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 getPageTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getPageTitle(App\Request $request)
        {
            $moduleName = $request->getModule();
            $record = $request->getInteger('record');
            switch ($request->getMode()) {
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 checkPermission() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
    Open

        public function checkPermission(App\Request $request)
        {
            $currentUserModel = Users_Record_Model::getCurrentUserModel();
            switch ($request->getMode()) {
                case 'reset':
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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

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

            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phpmd

    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\Language' in method 'change'.
    Open

                    $viewer->assign('WARNING', \App\Language::translate('LBL_FORCE_PASSWORD_CHANGE_ALERT', $moduleName));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Language' in method 'change'.
    Open

                    $viewer->assign('WARNING', \App\Language::translate('LBL_PWNED_PASSWORD_CHANGE_ALERT', $moduleName));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Language' in method 'change'.
    Open

                            $viewer->assign('WARNING', \App\Language::translateArgs('LBL_YOUR_PASSWORD_WILL_EXPIRE', $moduleName, \App\Fields\DateTime::getDiff(date('Y-m-d'), date('Y-m-d', strtotime("+$time day", strtotime($userModel->getDetail('date_password_change')))), 'days')));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 'checkPermission'.
    Open

                    if (\App\User::getCurrentUserId() === \App\User::getCurrentUserRealId() && (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record'))) {
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Session' in method 'change'.
    Open

                            \App\Session::delete('ShowUserPasswordChange');
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                } else {
                    switch ((int) \App\Session::get('ShowUserPasswordChange')) {
                        case 1:
                            $time = (int) $passConfig['change_time'] + (int) $passConfig['lock_time'];
                            $viewer->assign('WARNING', \App\Language::translateArgs('LBL_YOUR_PASSWORD_WILL_EXPIRE', $moduleName, \App\Fields\DateTime::getDiff(date('Y-m-d'), date('Y-m-d', strtotime("+$time day", strtotime($userModel->getDetail('date_password_change')))), 'days')));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Fields\DateTime' in method 'change'.
    Open

                            $viewer->assign('WARNING', \App\Language::translateArgs('LBL_YOUR_PASSWORD_WILL_EXPIRE', $moduleName, \App\Fields\DateTime::getDiff(date('Y-m-d'), date('Y-m-d', strtotime("+$time day", strtotime($userModel->getDetail('date_password_change')))), 'days')));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'App\Condition' in method 'massReset'.
    Open

            $viewer->assign('SEARCH_PARAMS', App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Mail' in method 'massReset'.
    Open

            $viewer->assign('ACTIVE_SMTP', App\Mail::getDefaultSmtp());
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 'change'.
    Open

            if (App\User::getCurrentUserId() === $request->getInteger('record')) {
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 'preProcessAjax'.
    Open

            if (App\User::getCurrentUserId() === $request->getInteger('record')
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Session' in method 'preProcessAjax'.
    Open

                || 2 === (int) \App\Session::get('ShowUserPasswordChange'))
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 '\Settings_Password_Record_Model' in method 'change'.
    Open

            $passConfig = \Settings_Password_Record_Model::getUserPassConfig();
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $viewer->assign('WARNING', \App\Language::translate('LBL_CHANGING_PASSWORD_OF_ANOTHER_USER', $moduleName));
            }
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            $this->pageTitle = \App\Language::translate($modeTitle, $moduleName);
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 'Users_Record_Model' in method 'checkPermission'.
    Open

            $currentUserModel = Users_Record_Model::getCurrentUserModel();
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Mail' in method 'reset'.
    Open

            $viewer->assign('ACTIVE_SMTP', App\Mail::getDefaultSmtp());
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Language' in method 'change'.
    Open

                $viewer->assign('WARNING', \App\Language::translate('LBL_CHANGING_PASSWORD_OF_ANOTHER_USER', $moduleName));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 'change'.
    Open

                $userModel = App\User::getCurrentUserModel();
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 'checkPermission'.
    Open

                    if (\App\User::getCurrentUserId() === \App\User::getCurrentUserRealId() && (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record'))) {
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                $this->pageTitle .= ' - ' . App\Fields\Owner::getUserLabel($record);
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Session' in method 'change'.
    Open

                    switch ((int) \App\Session::get('ShowUserPasswordChange')) {
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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\Language' in method 'change'.
    Open

                            $viewer->assign('WARNING', \App\Language::translate('LBL_YOUR_PASSWORD_HAS_EXPIRED', $moduleName));
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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 "MODE_TITLE" 3 times.
    Open

            $viewer->assign('MODE_TITLE', 'LBL_RESET_PASSWORD_HEAD');
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "RECORD" 3 times.
    Open

            $viewer->assign('RECORD', $request->getInteger('record'));
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "Modals/PasswordModal.tpl" 3 times.
    Open

            $viewer->view('Modals/PasswordModal.tpl', $moduleName);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "WARNING" 6 times.
    Open

            $viewer->assign('WARNING', '');
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "change" 4 times.
    Open

            $this->exposeMethod('change');
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "reset" 4 times.
    Open

            $this->exposeMethod('reset');
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "MODULE_NAME" 3 times.
    Open

            $viewer->assign('MODULE_NAME', $moduleName);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "ShowUserPasswordChange" 3 times.
    Open

                || 2 === (int) \App\Session::get('ShowUserPasswordChange'))
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "massReset" 4 times.
    Open

            $this->exposeMethod('massReset');
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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 "record" 7 times.
    Open

                    if (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record')) {
    Severity: Critical
    Found in modules/Users/views/PasswordModal.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.

    Reference to undeclared class \App\Controller\Modal
    Open

            parent::__construct();
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

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

                $userModel = App\User::getCurrentUserModel();
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

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

            if (App\User::getCurrentUserId() === $request->getInteger('record')
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared property \Users_PasswordModal_View->modalIcon
    Open

                    $this->modalIcon = 'fas fa-redo-alt';
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared class \App\Controller\Modal
    Open

            parent::preProcessAjax($request);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Call to undeclared method \Users_PasswordModal_View::getViewer
    Open

            $viewer = $this->getViewer($request);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Class extends undeclared class \App\Controller\Modal
    Open

    class Users_PasswordModal_View extends \App\Controller\Modal
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

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

                    if (\App\User::getCurrentUserId() === \App\User::getCurrentUserRealId() && (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record'))) {
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared property \Users_PasswordModal_View->pageTitle
    Open

            $this->pageTitle = \App\Language::translate($modeTitle, $moduleName);
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phan

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

            if (App\User::getCurrentUserId() === $request->getInteger('record')) {
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Call to undeclared method \Users_PasswordModal_View::getViewer
    Open

            $viewer = $this->getViewer($request);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

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

                    if (\App\User::getCurrentUserId() === \App\User::getCurrentUserRealId() && (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record'))) {
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared property \Users_PasswordModal_View->pageTitle
    Open

                $this->pageTitle .= ' - ' . App\Fields\Owner::getUserLabel($record);
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared property \Users_PasswordModal_View->modalIcon
    Open

                    $this->modalIcon = 'fas fa-key';
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phan

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

                $this->pageTitle .= ' - ' . App\Fields\Owner::getUserLabel($record);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Call to undeclared method \Users_PasswordModal_View::getViewer
    Open

            $viewer = $this->getViewer($request);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared property \Users_PasswordModal_View->pageTitle
    Open

            return $this->pageTitle;
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phan

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

                && (1 === (int) App\User::getCurrentUserModel()->getDetail('force_password_change')
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared property \Users_PasswordModal_View->modalIcon
    Open

                    $this->modalIcon = 'fas fa-redo-alt';
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phan

    Reference to undeclared property \Users_PasswordModal_View->lockExit
    Open

                $this->lockExit = true;
    Severity: Minor
    Found in modules/Users/views/PasswordModal.php by phan

    Call to undeclared method \Users_PasswordModal_View::getViewer
    Open

            $viewer = $this->getViewer($request);
    Severity: Critical
    Found in modules/Users/views/PasswordModal.php by phan

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            switch ($request->getMode()) {
                case 'reset':
                    if (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record')) {
                        return true;
                    }
    Severity: Major
    Found in modules/Users/views/PasswordModal.php and 1 other location - About 3 hrs to fix
    modules/Users/actions/Password.php on lines 39..57

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 148.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    class Users_PasswordModal_View extends \App\Controller\Modal

    The class Users_PasswordModal_View is not named in CamelCase.
    Open

    class Users_PasswordModal_View extends \App\Controller\Modal
    {
        use \App\Controller\ExposeMethod;
    
        /** {@inheritdoc} */
    Severity: Minor
    Found in modules/Users/views/PasswordModal.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

    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;

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

    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

            $this->exposeMethod('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

            $currentUserModel = Users_Record_Model::getCurrentUserModel();

    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

            $record = $request->getInteger('record');

    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

         * Reset user password.

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

            $viewer->view('Modals/PasswordModal.tpl', $moduleName);

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

            $this->exposeMethod('reset');

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

                    if (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record')) {

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

        /** {@inheritdoc} */

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

                    }

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

                    }

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

                default:

    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

            $viewer->assign('MODE_TITLE', 'LBL_RESET_PASSWORD_HEAD');

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

        }

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

            $viewer->assign('PASS_CONFIG', $passConfig);

    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

            $viewer->view('Modals/PasswordModal.tpl', $moduleName);

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

        use \App\Controller\ExposeMethod;

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

                        return true;

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

                || 'pwned' === $request->getByType('type')

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

        }

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

            $viewer->assign('MODULE_NAME', $moduleName);

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

            $viewer->assign('MODE', 'reset');

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

        /**

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

                } else {

    Line exceeds 120 characters; contains 279 characters
    Open

                            $viewer->assign('WARNING', \App\Language::translateArgs('LBL_YOUR_PASSWORD_WILL_EXPIRE', $moduleName, \App\Fields\DateTime::getDiff(date('Y-m-d'), date('Y-m-d', strtotime("+$time day", strtotime($userModel->getDetail('date_password_change')))), 'days')));

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

        public function checkPermission(App\Request $request)

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

                case 'change':

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

            $moduleName = $request->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

                    break;

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

        public function preProcessAjax(App\Request $request)

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

            if (App\User::getCurrentUserId() === $request->getInteger('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

            $viewer->assign('RECORD', $request->getInteger('record'));

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

            $viewer->assign('MODE', 'change');

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

                        case 2:

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

         * Mass reset user password.

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

            $viewer->assign('MODE', 'massReset');

    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

            switch ($request->getMode()) {

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

            }

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

            $viewer->assign('ACTIVE_SMTP', App\Mail::getDefaultSmtp());

    Line exceeds 120 characters; contains 123 characters
    Open

                            $viewer->assign('WARNING', \App\Language::translate('LBL_YOUR_PASSWORD_HAS_EXPIRED', $moduleName));

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

        public function massReset(App\Request $request)

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

            $viewer->assign('MODULE_NAME', $moduleName);

    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

        /** {@inheritdoc} */

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

                    break;

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

            if ($record) {

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

            $viewer = $this->getViewer($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 change(App\Request $request)

    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

            $viewer->assign('ACTIVE_SMTP', App\Mail::getDefaultSmtp());

    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

            switch ($request->getMode()) {

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

                case 'reset':

    Line exceeds 120 characters; contains 137 characters
    Open

                    if (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('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

                && (1 === (int) App\User::getCurrentUserModel()->getDetail('force_password_change')

    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 \App\Request $request

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

                } elseif ('pwned' === $request->getByType('type')) {

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

                            $viewer->assign('WARNING', \App\Language::translateArgs('LBL_YOUR_PASSWORD_WILL_EXPIRE', $moduleName, \App\Fields\DateTime::getDiff(date('Y-m-d'), date('Y-m-d', strtotime("+$time day", strtotime($userModel->getDetail('date_password_change')))), 'days')));

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

            }

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

            parent::__construct();

    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

                    $this->modalIcon = 'fas fa-redo-alt';

    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 reset(App\Request $request)

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

            $viewer->assign('WARNING', '');

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

                    $viewer->assign('WARNING', \App\Language::translate('LBL_PWNED_PASSWORD_CHANGE_ALERT', $moduleName));

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

                            $viewer->assign('WARNING', \App\Language::translate('LBL_YOUR_PASSWORD_HAS_EXPIRED', $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

            $viewer->assign('MODE_TITLE', 'LBL_MASS_RESET_PASSWORD_HEAD');

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

            $viewer->assign('SELECTED_IDS', $request->getArray('selected_ids', 2));

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

                        return true;

    Line exceeds 120 characters; contains 132 characters
    Open

            $viewer->assign('SEARCH_PARAMS', App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));

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

                    $this->modalIcon = 'fas fa-key';

    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

                    $this->modalIcon = 'fas fa-redo-alt';

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

                case 'massReset':

    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

            $viewer->assign('MODULE_NAME', $moduleName);

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

                    $viewer->assign('WARNING', \App\Language::translate('LBL_FORCE_PASSWORD_CHANGE_ALERT', $moduleName));

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

                        case 1:

    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

            $moduleName = $request->getModule();

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

        }

    Line exceeds 120 characters; contains 210 characters
    Open

                    if (\App\User::getCurrentUserId() === \App\User::getCurrentUserRealId() && (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record'))) {

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

                case 'massReset':

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

                    if (true === $currentUserModel->isAdminUser()) {

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

            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

                    $modeTitle = 'LBL_CHANGE_PASSWORD';

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

                $this->lockExit = true;

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

            parent::preProcessAjax($request);

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

            $viewer = $this->getViewer($request);

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

                        return true;

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

                    }

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

                    $modeTitle = 'LBL_MASS_RESET_PASSWORD_HEAD';

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

            $moduleName = $request->getModule();

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

            $moduleName = $request->getModule();

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

            $viewer->assign('MODE_TITLE', 'LBL_CHANGE_PASSWORD');

    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

                    break;

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

        public function getPageTitle(App\Request $request)

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

                case 'reset':

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

                    $modeTitle = 'LBL_RESET_PASSWORD_HEAD';

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

                $this->pageTitle .= ' - ' . App\Fields\Owner::getUserLabel($record);

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

            return $this->pageTitle;

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

            $viewer->view('Modals/PasswordModal.tpl', $moduleName);

    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

        public function __construct()

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

                    if (\App\User::getCurrentUserId() === \App\User::getCurrentUserRealId() && (true === $currentUserModel->isAdminUser() || (int) $currentUserModel->get('id') === $request->getInteger('record'))) {

    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

            $this->pageTitle = \App\Language::translate($modeTitle, $moduleName);

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

                || 2 === (int) \App\Session::get('ShowUserPasswordChange'))

    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::getCurrentUserId() === $request->getInteger('record')) {

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

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

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

                            \App\Session::delete('ShowUserPasswordChange');

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

            $viewer->assign('SEARCH_PARAMS', App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));

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

                if (1 === (int) $userModel->getDetail('force_password_change')) {

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

                    switch ((int) \App\Session::get('ShowUserPasswordChange')) {

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

                            $time = (int) $passConfig['change_time'] + (int) $passConfig['lock_time'];

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

            $viewer->assign('RECORD', null);

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

        }

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

            $viewer = $this->getViewer($request);

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

                $viewer->view('Modals/PasswordModalFooter.tpl', $request->getModule());

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

            $viewer->assign('RECORD', $request->getInteger('record'));

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

            } else {

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

         */

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

        {

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

            $viewer->assign('EXCLUDED_IDS', $request->getArray('excluded_ids', 2));

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

            if (!$request->getBoolean('onlyBody')) {

    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

            $this->exposeMethod('change');

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

         * Change user password.

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

            $passConfig = \Settings_Password_Record_Model::getUserPassConfig();

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

                $viewer->assign('WARNING', \App\Language::translate('LBL_CHANGING_PASSWORD_OF_ANOTHER_USER', $moduleName));

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

            $viewer = $this->getViewer($request);

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

        public function postProcessAjax(App\Request $request)

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

    class Users_PasswordModal_View extends \App\Controller\Modal

    Closing brace must be on a line by itself
    Open

                        default: break;

    There are no issues that match your filters.

    Category
    Status