YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Password/actions/Save.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
0%

Method encryption has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function encryption(App\Request $request)
    {
        $method = $request->isEmpty('methods') ? '' : $request->getByType('methods', 'Text');
        $vector = $request->getRaw('vector');
        $pass = $request->getRaw('password');
Severity: Minor
Found in modules/Settings/Password/actions/Save.php - About 1 hr to fix

    Function encryption has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function encryption(App\Request $request)
        {
            $method = $request->isEmpty('methods') ? '' : $request->getByType('methods', 'Text');
            $vector = $request->getRaw('vector');
            $pass = $request->getRaw('password');
    Severity: Minor
    Found in modules/Settings/Password/actions/Save.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

    The method encryption() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
    Open

        public function encryption(App\Request $request)
        {
            $method = $request->isEmpty('methods') ? '' : $request->getByType('methods', 'Text');
            $vector = $request->getRaw('vector');
            $pass = $request->getRaw('password');

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

        public function encryption(App\Request $request)
        {
            $method = $request->isEmpty('methods') ? '' : $request->getByType('methods', 'Text');
            $vector = $request->getRaw('vector');
            $pass = $request->getRaw('password');

    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 '64', column '19').
    Open

            $response = new Vtiger_Response();

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||methods', 406);

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '88', column '19').
    Open

            $response = new \Vtiger_Response();

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||password', 406);

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||target', 406);

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '123', column '19').
    Open

            $response = new \Vtiger_Response();

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||target', 406);

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

            $osm = new \App\ConfigFile('module', 'Users');

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '39', column '19').
    Open

            $response = new Vtiger_Response();

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

                $resp = \App\Language::translate('LBL_ERROR', $moduleName);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Encryption' in method 'checkEncryptionStatus'.
    Open

            $instance = \App\Encryption::getInstance($target);

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

                $message = App\Language::translate('LBL_ENCRYPTION_WAITING', $request->getModule(false));

    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\Encryption' in method 'encryption'.
    Open

            if ($method && \strlen($vector) !== App\Encryption::getLengthVector($method)) {

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

            } else {
                $vale = $request->getBoolean('vale') ? 'true' : 'false';
            }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

                $resp = \App\Language::translate('LBL_SAVE_OK', $moduleName);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                $response->setResult(App\Language::translate('LBL_NO_REGISTER_ENCRYPTION', $request->getModule(false)));

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

            } else {
                $resp = \App\Language::translate('LBL_ERROR', $moduleName);
            }

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

                $response->setResult(App\Language::translate('LBL_REGISTER_ENCRYPTION', $request->getModule(false)));

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

            if (Settings_Password_Record_Model::validation($type, $vale)) {

    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\Encryption' in method 'encryption'.
    Open

            $instance = clone \App\Encryption::getInstance($target);

    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\Encryption' in method 'encryption'.
    Open

            if ($method && !\in_array($method, \App\Encryption::getMethods())) {

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

                $message = App\Language::translate('LBL_ENCRYPTION_RUN', $request->getModule(false));

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

            } else {
                $instance->reload($method);
                $response->setResult(App\Language::translate('LBL_REGISTER_ENCRYPTION', $request->getModule(false)));
            }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            $response->setResult(['success' => true, 'message' => \App\Language::translate('LBL_CHANGES_SAVED')]);

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

                $response->setResult(App\Language::translate('LBL_DISABLE_ENCRYPTION', $request->getModule(false)));

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

                Settings_Password_Record_Model::setPassDetail($type, $vale);

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

            $target = $request->getInteger('target', null);

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Argument 2 (value) is null but \App\Request::getInteger() takes int defined at /code/app/Request.php:200
    Open

            $target = $request->getInteger('target', null);

    Call to method getMethods from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
    Open

            if ($method && !\in_array($method, \App\Encryption::getMethods())) {
    Severity: Critical
    Found in modules/Settings/Password/actions/Save.php by phan

    Argument 2 (value) is null but \App\Request::getInteger() takes int defined at /code/app/Request.php:200
    Open

            $target = $request->getInteger('target', null);

    Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
    Open

            $instance = \App\Encryption::getInstance($target);
    Severity: Critical
    Found in modules/Settings/Password/actions/Save.php by phan

    Call to method getLengthVector from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
    Open

            if ($method && \strlen($vector) !== App\Encryption::getLengthVector($method)) {
    Severity: Critical
    Found in modules/Settings/Password/actions/Save.php by phan

    Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
    Open

            $instance = clone \App\Encryption::getInstance($target);
    Severity: Critical
    Found in modules/Settings/Password/actions/Save.php by phan

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

    class Settings_Password_Save_Action extends Settings_Vtiger_Index_Action

    The class Settings_Password_Save_Action is not named in CamelCase.
    Open

    class Settings_Password_Save_Action extends Settings_Vtiger_Index_Action
    {
        use \App\Controller\ExposeMethod;
    
        /**

    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

         * Action change configuration for pwned.

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

        {

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

                $resp = \App\Language::translate('LBL_SAVE_OK', $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

        }

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||target', 406);

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

         * @throws \App\Exceptions\IllegalValue

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

            $method = $request->isEmpty('methods') ? '' : $request->getByType('methods', 'Text');

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

            $vector = $request->getRaw('vector');

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

            $this->exposeMethod('encryption');

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

         * Action change configuration for password.

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

            if (Settings_Password_Record_Model::validation($type, $vale)) {

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

                Settings_Password_Record_Model::setPassDetail($type, $vale);

    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

        {

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

                $message = App\Language::translate('LBL_ENCRYPTION_RUN', $request->getModule(false));

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

                $response->setResult(App\Language::translate('LBL_DISABLE_ENCRYPTION', $request->getModule(false)));

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

        }

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

         * @param \App\Request $request

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

        public function pass(App\Request $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

            $pass = $request->getRaw('password');

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

            $this->exposeMethod('pwned');

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

            $response = new Vtiger_Response();

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

         *

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

         */

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

            }

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

         *

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

            }

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

            if (null === $target) {

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

            $response = new \Vtiger_Response();

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

            if (!$method) {

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

                $instance->reload($method);

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

                $response->setResult(App\Language::translate('LBL_REGISTER_ENCRYPTION', $request->getModule(false)));

    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

        {

    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

                $message = App\Language::translate('LBL_ENCRYPTION_WAITING', $request->getModule(false));

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

            } elseif ($instance->isRunning()) {

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

            if ($method && \strlen($vector) !== App\Encryption::getLengthVector($method)) {

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

    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

            $response->emit();

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

            if ($instance->isReady()) {

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||target', 406);

    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

            $osm->create();

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

        }

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

            $target = $request->getInteger('target', null);

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

        /**

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

         *

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

        {

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

                ->set('pass', $pass)

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

                ->set('target', $target);

    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

            $osm = new \App\ConfigFile('module', 'Users');

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

            $response = new Vtiger_Response();

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

            if ($method && !\in_array($method, \App\Encryption::getMethods())) {

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

        /**

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

         * Constructor.

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

            if (\in_array($type, ['min_length', 'max_length', 'change_time', 'lock_time', 'pwned_time'])) {

    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

                $resp = \App\Language::translate('LBL_ERROR', $moduleName);

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

            $response->setResult($resp);

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

                $response->setResult(App\Language::translate('LBL_NO_REGISTER_ENCRYPTION', $request->getModule(false)));

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

            }

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

            $response->emit();

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

            $moduleName = $request->getModule(false);

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

            if (null === $target) {

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

         * Action to set password and method for encryption.

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

            }

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

            $encryption = $instance->encrypt('test', 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

            $this->exposeMethod('checkEncryptionStatus');

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

        /**

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

            $message = '';

    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

            parent::__construct();

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

        /**

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

         * Validation before saving.

    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

         */

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||methods', 406);

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

            $response->emit();

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

        /**

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

                $vale = $request->getBoolean('vale') ? 'true' : 'false';

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

            $response->emit();

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

                $instance->reload($method);

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

            $this->exposeMethod('pass');

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

        }

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

            $osm->set('pwnedPasswordProvider', $request->getByType('vale', 'Text'));

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

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

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

        public function checkEncryptionStatus(App\Request $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

            $response = new \Vtiger_Response();

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

                $vector = $pass = '';

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||password', 406);

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

            $instance = clone \App\Encryption::getInstance($target);

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

            } elseif (empty($encryption) || 'test' === $encryption) {

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

            $type = $request->getByType('type', 'Alnum');

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

            $instance->set('method', $method)

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

                ->set('vector', $vector)

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

         */

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

            $response->setResult(['success' => true, 'message' => \App\Language::translate('LBL_CHANGES_SAVED')]);

    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

            $instance = \App\Encryption::getInstance($target);

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

            $response->setResult(['result' => empty($message), 'message' => $message]);

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

        public function encryption(App\Request $request)

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

            $target = $request->getInteger('target', null);

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

            if (!$method) {

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

    class Settings_Password_Save_Action extends Settings_Vtiger_Index_Action

    There are no issues that match your filters.

    Category
    Status