YetiForceCompany/YetiForceCRM

View on GitHub
tests/Base/Z_Authy2FA.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

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

        $row = (new \App\Db\Query())
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 '50', column '21').
Open

        $authMethod = new \Users_Totp_Authmethod(\App\User::getCurrentUserRealId());
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'testConfig'.
Open

        \App\Config::set('main', 'systemMode', 'prod');
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'testConfig'.
Open

        \App\Config::set('main', 'systemMode', 'demo');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

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

        self::$userId = \App\User::getUserIdByName('demo');
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'testConfig'.
Open

        \App\Config::set('security', 'USER_AUTHY_MODE', 'TOTP_OFF');
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'tearDownAfterClass'.
Open

        \App\Config::set('security', 'USER_AUTHY_MODE', self::$userAuthyMode);
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'tearDownAfterClass'.
Open

        \App\Cache::clear();
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'testConfig'.
Open

        $this->assertSame(\App\Config::security('USER_AUTHY_MODE'), 'TOTP_OFF', 'Problem with saving the configuration');
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'testConfig'.
Open

        \App\Config::set('security', 'USER_AUTHY_MODE', 'TOTP_OBLIGATORY');
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'setUpBeforeClass'.
Open

        self::$userAuthyMode = \App\Config::security('USER_AUTHY_MODE');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\Users_Record_Model' in method 'testUser'.
Open

        $userRecordModel = \Users_Record_Model::getInstanceById(self::$userId, 'Users');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

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

        $authMethod = new \Users_Totp_Authmethod(\App\User::getCurrentUserRealId());
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'setUpBeforeClass'.
Open

        self::$systemMode = \App\Config::main('systemMode');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

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

        \App\User::setCurrentUserId(self::$userId);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

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

        $this->assertSame(\App\User::getCurrentUserId(), self::$userId);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\Users_Totp_Authmethod' in method 'testConfig'.
Open

        $this->assertFalse(\Users_Totp_Authmethod::isActive());
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\Users_Totp_Authmethod' in method 'testConfig'.
Open

        $this->assertFalse(\Users_Totp_Authmethod::isActive());
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 'tearDownAfterClass'.
Open

        \App\Config::set('main', 'systemMode', self::$systemMode);
Severity: Minor
Found in tests/Base/Z_Authy2FA.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 "security" 3 times.
Open

        \App\Config::set('security', 'USER_AUTHY_MODE', 'TOTP_OFF');
Severity: Critical
Found in tests/Base/Z_Authy2FA.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 "USER_AUTHY_MODE" 5 times.
Open

        self::$userAuthyMode = \App\Config::security('USER_AUTHY_MODE');
Severity: Critical
Found in tests/Base/Z_Authy2FA.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 "authy_methods" 3 times.
Open

        $userRecordModel->set('authy_methods', '');
Severity: Critical
Found in tests/Base/Z_Authy2FA.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 "authy_secret_totp" 3 times.
Open

        $userRecordModel->set('authy_secret_totp', '');
Severity: Critical
Found in tests/Base/Z_Authy2FA.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 "systemMode" 4 times.
Open

        self::$systemMode = \App\Config::main('systemMode');
Severity: Critical
Found in tests/Base/Z_Authy2FA.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\Db\Query::select
Open

        $row = (new \App\Db\Query())
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

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

        $this->assertSame(\App\User::getCurrentUserId(), self::$userId);
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertIsInt
Open

        $this->assertIsInt(self::$userId, 'No user demo');
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertNotFalse
Open

        $this->assertNotFalse($row, 'No record id: ' . self::$userId);
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertEmpty
Open

        $this->assertEmpty($row['authy_methods']);
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertFalse
Open

        $this->assertFalse(\Users_Totp_Authmethod::isActive());
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

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

        $authMethod = new \Users_Totp_Authmethod(\App\User::getCurrentUserRealId());
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Property \Tests\Base\Z_Authy2FA::$transaction has undeclared type \yii\db\Transaction
Open

    private static $transaction;
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertTrue
Open

        $this->assertTrue($authMethod->verifyCode($secret, $authMethod->getCode()), 'The "verifyCode" method does not work');
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertFalse
Open

        $this->assertFalse(\Users_Totp_Authmethod::isActive());
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

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

        self::$transaction = \App\Db::getInstance()->beginTransaction();
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

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

        self::$userId = \App\User::getUserIdByName('demo');
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to method rollBack from undeclared class \yii\db\Transaction
Open

        self::$transaction->rollBack();
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertFalse
Open

        $this->assertFalse($authMethod->verifyCode($secret, '123000'), 'The "verifyCode" method does not work');
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

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

        \App\User::setCurrentUserId(self::$userId);
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertSame
Open

        $this->assertSame(\App\User::getCurrentUserId(), self::$userId);
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertEmpty
Open

        $this->assertEmpty($row['authy_secret_totp']);
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

Call to undeclared method \Tests\Base\Z_Authy2FA::assertSame
Open

        $this->assertSame(\App\Config::security('USER_AUTHY_MODE'), 'TOTP_OFF', 'Problem with saving the configuration');
Severity: Critical
Found in tests/Base/Z_Authy2FA.php by phan

The class Z_Authy2FA is not named in CamelCase.
Open

class Z_Authy2FA extends \Tests\Base
{
    /**
     * @var \yii\db\Transaction
     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpmd

CamelCaseClassName

Since: 0.2

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

Example

class class_name {
}

Source

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

    }
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * @var \yii\db\Transaction
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    public function testUser()
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * @codeCoverageIgnore
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        self::$userAuthyMode = \App\Config::security('USER_AUTHY_MODE');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * Test method "verifyCode".
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertFalse($authMethod->verifyCode($secret, '123000'), 'The "verifyCode" method does not work');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * @var int
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $secret = $authMethod->createSecret();
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * Setting of tests.
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    public function testVerifyCode()
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        self::$systemMode = \App\Config::main('systemMode');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    private static $userId;
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    private static $systemMode;
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    public static function setUpBeforeClass(): void
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

Line exceeds 120 characters; contains 125 characters
Open

        $this->assertTrue($authMethod->verifyCode($secret, $authMethod->getCode()), 'The "verifyCode" method does not work');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    private static $transaction;
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    private static $userAuthyMode;
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $authMethod = new \Users_Totp_Authmethod(\App\User::getCurrentUserRealId());
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertTrue($authMethod->verifyCode($secret, $authMethod->getCode()), 'The "verifyCode" method does not work');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * Test user for 2FA.
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $userRecordModel = \Users_Record_Model::getInstanceById(self::$userId, 'Users');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    public function testConfig(): void
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\Config::set('main', 'systemMode', self::$systemMode);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

Line exceeds 120 characters; contains 121 characters
Open

        $this->assertSame(\App\Config::security('USER_AUTHY_MODE'), 'TOTP_OFF', 'Problem with saving the configuration');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * @var string
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * @var string
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

            ->select(['authy_secret_totp', 'authy_methods'])
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * Test config for 2FA.
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        self::$transaction = \App\Db::getInstance()->beginTransaction();
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\Config::set('security', 'USER_AUTHY_MODE', 'TOTP_OFF');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\Config::set('security', 'USER_AUTHY_MODE', self::$userAuthyMode);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\Config::set('main', 'systemMode', 'demo');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertIsInt(self::$userId, 'No user demo');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

            ->one();
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertEmpty($row['authy_methods']);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     * Cleaning after tests.
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $userRecordModel->set('authy_secret_totp', '');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $userRecordModel->set('authy_methods', '');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $userRecordModel->save();
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

            ->where(['id' => self::$userId])
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertFalse(\Users_Totp_Authmethod::isActive());
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\User::setCurrentUserId(self::$userId);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\Config::set('main', 'systemMode', 'prod');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        self::$userId = \App\User::getUserIdByName('demo');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

            ->from('vtiger_users')
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertEmpty($row['authy_secret_totp']);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertFalse(\Users_Totp_Authmethod::isActive());
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    {
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        self::$transaction->rollBack();
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $row = (new \App\Db\Query())
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertSame(\App\Config::security('USER_AUTHY_MODE'), 'TOTP_OFF', 'Problem with saving the configuration');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\Cache::clear();
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertSame(\App\User::getCurrentUserId(), self::$userId);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        $this->assertNotFalse($row, 'No record id: ' . self::$userId);
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

        \App\Config::set('security', 'USER_AUTHY_MODE', 'TOTP_OBLIGATORY');
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

    public static function tearDownAfterClass(): void
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

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

class Z_Authy2FA extends \Tests\Base
Severity: Minor
Found in tests/Base/Z_Authy2FA.php by phpcodesniffer

There are no issues that match your filters.

Category
Status