YetiForceCompany/YetiForceCRM

View on GitHub
app/Encryptions/Settings.php

Summary

Maintainability
C
1 day
Test Coverage
F
17%

Function recalculatePasswords has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public static function recalculatePasswords(string $method, string $password, string $vector)
    {
        $dbAdmin = \App\Db::getInstance('admin');
        $decryptInstance = static::getInstance();
        if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
Severity: Minor
Found in app/Encryptions/Settings.php - About 6 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Method recalculatePasswords has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function recalculatePasswords(string $method, string $password, string $vector)
    {
        $dbAdmin = \App\Db::getInstance('admin');
        $decryptInstance = static::getInstance();
        if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
Severity: Major
Found in app/Encryptions/Settings.php - About 2 hrs to fix

    The method recalculatePasswords() has an NPath complexity of 316. The configured NPath complexity threshold is 200.
    Open

        public static function recalculatePasswords(string $method, string $password, string $vector)
        {
            $dbAdmin = \App\Db::getInstance('admin');
            $decryptInstance = static::getInstance();
            if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpmd

    NPathComplexity

    Since: 0.1

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

    Example

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

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

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

        public static function recalculatePasswords(string $method, string $password, string $vector)
        {
            $dbAdmin = \App\Db::getInstance('admin');
            $decryptInstance = static::getInstance();
            if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpmd

    CyclomaticComplexity

    Since: 0.1

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

    Example

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

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

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

        public static function recalculatePasswords(string $method, string $password, string $vector)
    Severity: Critical
    Found in app/Encryptions/Settings.php by sonar-php

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

    See

    Missing class import via use statement (line '93', column '22').
    Open

                $configFile = new \App\ConfigFile('securityKeys');
    Severity: Minor
    Found in app/Encryptions/Settings.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

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

        public function isActive(bool $testMode = false)
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

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

                                    throw new \App\Exceptions\AppException('ERR_IMPOSSIBLE_ENCRYPT');
    Severity: Minor
    Found in app/Encryptions/Settings.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

    Missing class import via use statement (line '83', column '20').
    Open

                                        throw new \App\Exceptions\AppException('ERR_IMPOSSIBLE_DECRYPT');
    Severity: Minor
    Found in app/Encryptions/Settings.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

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||target', 406);
    Severity: Minor
    Found in app/Encryptions/Settings.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

    Missing class import via use statement (line '38', column '15').
    Open

            $row = (new \App\Db\Query())->from(static::TABLE_NAME)->where(['target' => $target])->one(\App\Db::getInstance('admin'));
    Severity: Minor
    Found in app/Encryptions/Settings.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

    Missing class import via use statement (line '70', column '20').
    Open

                    $values = (new \App\Db\Query())->select(array_merge([$info['index']], $info['columnName']))
    Severity: Minor
    Found in app/Encryptions/Settings.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

    Missing class import via use statement (line '122', column '22').
    Open

                $configFile = new \App\ConfigFile('securityKeys');
    Severity: Minor
    Found in app/Encryptions/Settings.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\Config' in method 'recalculatePasswords'.
    Open

                \App\Config::set('securityKeys', 'encryptionMethod', $method);
    Severity: Minor
    Found in app/Encryptions/Settings.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\Db' in method 'recalculatePasswords'.
    Open

            $dbAdmin = \App\Db::getInstance('admin');
    Severity: Minor
    Found in app/Encryptions/Settings.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\Db' in method 'recalculatePasswords'.
    Open

                        ->createCommand(\App\Db::getInstance($info['db']))
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            $method = \App\Config::securityKeys('encryptionMethod');
    Severity: Minor
    Found in app/Encryptions/Settings.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\Db' in method 'getInstance'.
    Open

            $row = (new \App\Db\Query())->from(static::TABLE_NAME)->where(['target' => $target])->one(\App\Db::getInstance('admin'));
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                \App\Config::set('securityKeys', 'encryptionPass', $password);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            $instance->set('pass', \App\Config::securityKeys('encryptionPass'));
    Severity: Minor
    Found in app/Encryptions/Settings.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\Cache' in method 'recalculatePasswords'.
    Open

                \App\Cache::clear();
    Severity: Minor
    Found in app/Encryptions/Settings.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 "index" 11 times.
    Open

            'roundcube_users' => ['columnName' => ['password'], 'index' => 'user_id', 'db' => 'base'],
    Severity: Critical
    Found in app/Encryptions/Settings.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 "method" 8 times.
    Open

                $instance->set('method', $row['method']);
    Severity: Critical
    Found in app/Encryptions/Settings.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 "target" 6 times.
    Open

            $row = (new \App\Db\Query())->from(static::TABLE_NAME)->where(['target' => $target])->one(\App\Db::getInstance('admin'));
    Severity: Critical
    Found in app/Encryptions/Settings.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 "admin" 6 times.
    Open

            's_#__mail_smtp' => ['columnName' => ['password', 'smtp_password'], 'index' => 'id', 'db' => 'admin'],
    Severity: Critical
    Found in app/Encryptions/Settings.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 "columnName" 10 times.
    Open

            'roundcube_users' => ['columnName' => ['password'], 'index' => 'user_id', 'db' => 'base'],
    Severity: Critical
    Found in app/Encryptions/Settings.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 "password" 3 times.
    Open

            'roundcube_users' => ['columnName' => ['password'], 'index' => 'user_id', 'db' => 'base'],
    Severity: Critical
    Found in app/Encryptions/Settings.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 "webservice" 3 times.
    Open

            'w_#__api_user' => ['columnName' => ['auth'], 'index' => 'id', 'db' => 'webservice'],
    Severity: Critical
    Found in app/Encryptions/Settings.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 "encryptionMethod" 4 times.
    Open

                $configFile->set('encryptionMethod', $method);
    Severity: Critical
    Found in app/Encryptions/Settings.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 "securityKeys" 4 times.
    Open

                $configFile = new \App\ConfigFile('securityKeys');
    Severity: Critical
    Found in app/Encryptions/Settings.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 "encryptionPass" 3 times.
    Open

            $instance->set('pass', \App\Config::securityKeys('encryptionPass'));
    Severity: Critical
    Found in app/Encryptions/Settings.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.

    Call to undeclared method \App\Encryptions\Settings::set
    Open

                $instance->set('vector', $row['pass']);
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

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

            $row = (new \App\Db\Query())->from(static::TABLE_NAME)->where(['target' => $target])->one(\App\Db::getInstance('admin'));
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::STATUS_ACTIVE
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::get
    Open

                || !\in_array($this->get('method'), static::getMethods())
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Class extends undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
    Open

    class Settings extends \App\Encryption
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TABLE_NAME
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => $decryptInstance->getTarget()])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

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

                    $values = (new \App\Db\Query())->select(array_merge([$info['index']], $info['columnName']))
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['method' => $method, 'pass' => $vector], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::set
    Open

                $instance->set('target', (int) $row['target']);
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::isEmpty
    Open

                || $this->isEmpty('method')
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TARGET_SETTINGS
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['method' => $method, 'pass' => $vector], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::set
    Open

                $instance->set('method', $row['method']);
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

                    $dbCommand = \App\Db::getInstance(self::$mapPasswords[$tableName]['db'])->createCommand();
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::encrypt
    Open

                                $value = $encryptInstance->encrypt($value);
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TARGET_SETTINGS
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::get
    Open

                || ($this->get('method') !== $method && !$testMode)
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::get
    Open

            $oldMethod = $decryptInstance->get('method');
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TABLE_NAME
    Open

            $row = (new \App\Db\Query())->from(static::TABLE_NAME)->where(['target' => $target])->one(\App\Db::getInstance('admin'));
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::get
    Open

            if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => $decryptInstance->getTarget()])->execute();
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TABLE_NAME
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TARGET_SETTINGS
    Open

            if ($target !== static::TARGET_SETTINGS) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::getTarget
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => $decryptInstance->getTarget()])->execute();
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Db::beginTransaction
    Open

            $transactionBase = \App\Db::getInstance()->beginTransaction();
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::decrypt
    Open

                                    $value = $decryptInstance->decrypt($value);
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Static call to undeclared method \App\Encryptions\Settings::getMethods
    Open

                || !\in_array($this->get('method'), static::getMethods())
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::STATUS_ACTIVE
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => $decryptInstance->getTarget()])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Db::beginTransaction
    Open

            $transactionAdmin = $dbAdmin->beginTransaction();
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TABLE_NAME
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['method' => $method, 'pass' => $vector], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Reference to undeclared constant \App\Encryptions\Settings::TARGET_SETTINGS
    Open

        public static function getInstance(int $target = self::TARGET_SETTINGS)
    Severity: Minor
    Found in app/Encryptions/Settings.php by phan

    Call to undeclared method \App\Encryptions\Settings::set
    Open

            $instance->set('pass', \App\Config::securityKeys('encryptionPass'));
    Severity: Critical
    Found in app/Encryptions/Settings.php by phan

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

        public static function getInstance(int $target = self::TARGET_SETTINGS)
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $instance->set('vector', $row['pass']);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            's_#__mail_smtp' => ['columnName' => ['password', 'smtp_password'], 'index' => 'id', 'db' => 'admin'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        ];
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            'roundcube_users' => ['columnName' => ['password'], 'index' => 'user_id', 'db' => 'base'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            return $instance;
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            \App\MeetingService::TABLE_NAME => ['columnName' => ['secret'], 'index' => 'id', 'db' => 'admin'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         * @param string $method
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            if ($target !== static::TARGET_SETTINGS) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

    Line exceeds 120 characters; contains 129 characters
    Open

            $row = (new \App\Db\Query())->from(static::TABLE_NAME)->where(['target' => $target])->one(\App\Db::getInstance('admin'));
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        /** {@inheritdoc} */
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            if ($row) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $instance->set('pass', \App\Config::securityKeys('encryptionPass'));
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            'a_#__smsnotifier_servers' => ['columnName' => ['api_key'], 'index' => 'id', 'db' => 'admin'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            'i_#__magento_servers' => ['columnName' => ['password'], 'index' => 'id', 'db' => 'admin'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $instance->set('method', $row['method']);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         * Function to change password for encryption.
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $instance->set('target', (int) $row['target']);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            'dav_users' => ['columnName' => ['key'], 'index' => 'id', 'db' => 'base'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                throw new \App\Exceptions\IllegalValue('ERR_NOT_ALLOWED_VALUE||target', 406);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $row = (new \App\Db\Query())->from(static::TABLE_NAME)->where(['target' => $target])->one(\App\Db::getInstance('admin'));
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            'w_#__portal_user' => ['columnName' => ['auth'], 'index' => 'id', 'db' => 'webservice'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        /** @var array Passwords to encrypt */
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            'w_#__api_user' => ['columnName' => ['auth'], 'index' => 'id', 'db' => 'webservice'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            'w_#__servers' => ['columnName' => ['pass', 'api_key'], 'index' => 'id', 'db' => 'webservice'],
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

    Line exceeds 120 characters; contains 155 characters
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => $decryptInstance->getTarget()])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                            foreach ($columns as &$value) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                \App\Cache::clear();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $dbAdmin = \App\Db::getInstance('admin');
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $decryptInstance = static::getInstance();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    $values = (new \App\Db\Query())->select(array_merge([$info['index']], $info['columnName']))
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                !\function_exists('openssl_encrypt')
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $configFile->create();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $encryptInstance = static::getInstance();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $configFile->create();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

    Line exceeds 120 characters; contains 152 characters
    Open

            if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $oldMethod = $decryptInstance->get('method');
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $configFile->set('encryptionPass', $password);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            try {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        foreach ($values as &$value) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    if (!$values) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                    $value = $decryptInstance->decrypt($value);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                            if (!empty($value)) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    $passwords[$tableName] = $values;
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $transactionAdmin->rollBack();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

    Line exceeds 120 characters; contains 154 characters
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['method' => $method, 'pass' => $vector], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                \App\Config::set('securityKeys', 'encryptionPass', $password);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         * @param bool $testMode
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                || $this->isEmpty('method')
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                || !\in_array($this->get('method'), static::getMethods())
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         * @param string $password
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        continue;
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                if (!empty($value)) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                throw $e;
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         * Checks if encrypt or decrypt is possible.
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => $decryptInstance->getTarget()])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $passwords = [];
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                    if (empty($value)) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $instance = new static();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $configFile = new \App\ConfigFile('securityKeys');
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        ->from($tableName)
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $transactionBase = \App\Db::getInstance()->beginTransaction();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                    }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                foreach (self::$mapPasswords as $tableName => $info) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                        throw new \App\Exceptions\AppException('ERR_IMPOSSIBLE_DECRYPT');
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    foreach ($pass as $index => $values) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        ->createCommand(\App\Db::getInstance($info['db']))
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $transactionBase->rollBack();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        foreach ($values as &$columns) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                || ($this->get('method') !== $method && !$testMode)
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                            }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['method' => $method, 'pass' => $vector], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            );
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                $value = $encryptInstance->encrypt($value);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $transactionBase->commit();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            } catch (\Throwable $e) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         * @param string $vector
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                return;
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $transactionAdmin = $dbAdmin->beginTransaction();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    if ($decryptInstance->isActive()) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $configFile->set('encryptionMethod', $method);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

                        $dbCommand->update($tableName, $values, [self::$mapPasswords[$tableName]['index'] => $index])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $transactionAdmin->commit();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        public function isActive(bool $testMode = false)
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        public static function recalculatePasswords(string $method, string $password, string $vector)
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

    Line exceeds 120 characters; contains 147 characters
    Open

                $dbAdmin->createCommand()->update(self::TABLE_NAME, ['status' => self::STATUS_ACTIVE], ['target' => self::TARGET_SETTINGS])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $configFile->set('encryptionMethod', $oldMethod);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                \App\Config::set('securityKeys', 'encryptionMethod', $method);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                foreach ($passwords as $tableName => $pass) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                if (empty($value)) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                    throw new \App\Exceptions\AppException('ERR_IMPOSSIBLE_ENCRYPT');
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                            }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        $dbCommand->update($tableName, $values, [self::$mapPasswords[$tableName]['index'] => $index])->execute();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        private static $mapPasswords = [
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                    $dbCommand = \App\Db::getInstance(self::$mapPasswords[$tableName]['db'])->createCommand();
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                                }
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            if ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password) {
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                        ->queryAllByGroup(1);
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

                $configFile = new \App\ConfigFile('securityKeys');
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            $method = \App\Config::securityKeys('encryptionMethod');
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

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

            return !(
    Severity: Minor
    Found in app/Encryptions/Settings.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status