autowp/external-login-service

View on GitHub

Showing 72 of 72 total issues

Avoid using static access to class '\Locale' in method 'getData'.
Open

            $data['language'] = Locale::getPrimaryLanguage($json['locale']);
Severity: Minor
Found in src/Facebook.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 '\DateTime' in method 'getData'.
Open

            $birthday = DateTime::createFromFormat('Y-m-d', $ownerDetailsArray['birthday']);
Severity: Minor
Found in src/GooglePlus.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

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

    public function getData(array $options): Result
    {
        $provider = $this->getProvider();

        if (isset($options['language'])) {
Severity: Minor
Found in src/Vk.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

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

    public function getFriends(): array
    {
        if (! $this->accessToken) {
            throw new ExternalLoginServiceException("Access token not provided");
        }
Severity: Minor
Found in src/Facebook.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

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

    public function getData(array $options): Result
    {
        $provider = $this->getProvider();

        $ownerDetails = $provider->getResourceOwner($this->accessToken);
Severity: Minor
Found in src/GooglePlus.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

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

    public function getData(array $options): Result
    {
        $provider = $this->getProvider();

        $ownerDetails = $provider->getResourceOwner($this->accessToken);
Severity: Minor
Found in src/Facebook.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

syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
Open

    private array $defaultScope = ['public_profile', 'user_friends', 'user_hometown'];
Severity: Critical
Found in src/Facebook.php by phan

Possibly zero references to public method \Autowp\ExternalLoginService\Linkedin::getFriends()
Open

    public function getFriends(): array
Severity: Minor
Found in src/Linkedin.php by phan

Possibly zero references to class \Autowp\ExternalLoginService\Module
Open

class Module
Severity: Minor
Found in src/Module.php by phan

Possibly zero references to protected property \Autowp\ExternalLoginService\PluginManager->factories
Open

    protected $factories = [
Severity: Minor
Found in src/PluginManager.php by phan

Possibly zero references to protected method \Autowp\ExternalLoginService\Vk::createProvider()
Open

    protected function createProvider(): VkProvider
Severity: Minor
Found in src/Vk.php by phan

Possibly zero references to protected method \Autowp\ExternalLoginService\Github::createProvider()
Open

    protected function createProvider(): GithubProvider
Severity: Minor
Found in src/Github.php by phan

Parameter $options is never used
Open

    public function getData(array $options): Result
Severity: Minor
Found in src/GooglePlus.php by phan

Parameter $options is never used
Open

    public function getData(array $options): Result
Severity: Minor
Found in src/Linkedin.php by phan

Possibly zero references to public method \Autowp\ExternalLoginService\Linkedin::getFriendsUrl()
Open

    public function getFriendsUrl(): string
Severity: Minor
Found in src/Linkedin.php by phan

Possibly zero references to public property \Autowp\ExternalLoginService\Provider\VkProvider->scopes
Open

    public $scopes = [
Severity: Minor
Found in src/Provider/VkProvider.php by phan

Call with 1 arg(s) to \Autowp\ExternalLoginService\Provider\VkProvider::__construct() which only takes 0 arg(s) defined at /code/src/Provider/VkProvider.php:10
Open

        return new VkProvider([
Severity: Info
Found in src/Vk.php by phan

Possibly zero references to public method \Autowp\ExternalLoginService\Vk::getData()
Open

    public function getData(array $options): Result
Severity: Minor
Found in src/Vk.php by phan

Possibly zero references to protected method \Autowp\ExternalLoginService\Linkedin::getFriendsAuthorizationUrl()
Open

    protected function getFriendsAuthorizationUrl(): string
Severity: Minor
Found in src/Linkedin.php by phan

Possibly zero references to public method \Autowp\ExternalLoginService\GooglePlus::getData()
Open

    public function getData(array $options): Result
Severity: Minor
Found in src/GooglePlus.php by phan
Severity
Category
Status
Source
Language