Firesphere/silverstripe-yubiauth

View on GitHub
src/Authenticators/YubikeyMemberAuthenticator.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused private fields such as '$authenticatorName'.
Open

    private $authenticatorName = 'yubiauth';

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid using static access to class '\SilverStripe\ORM\ValidationResult' in method 'validateToken'.
Open

            $validationResult = ValidationResult::create();

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 '\Firesphere\YubiAuth\Handlers\YubikeyLoginHandler' in method 'getLoginHandler'.
Open

        return YubikeyLoginHandler::create($link, $this);

StaticAccess

Since: 1.4.0

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

Example

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

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

The method get_name is not named in camelCase.
Open

    public static function get_name()
    {
        return _t(self::class . '.TITLE', 'Yubikey 2 factor login');
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status