autowp/external-login-service

View on GitHub

Showing 72 of 72 total issues

Function getFriends has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

public function getFriends(): array
{
if (! $this->accessToken) {
throw new ExternalLoginServiceException("Access token not provided");
}
Severity: Minor
Found in src/Facebook.php - About 2 hrs to fix

Function getData has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

public function getData(array $options): Result
{
$provider = $this->getProvider();
 
$ownerDetails = $provider->getResourceOwner($this->accessToken);
Severity: Minor
Found in src/GooglePlus.php - About 2 hrs to fix

Result has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class Result
{
/** @var string */
private string $externalId;
 
 
Severity: Minor
Found in src/Result.php - About 2 hrs to fix

    Method getData has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public function getData(array $options): Result
    {
    $provider = $this->getProvider();
     
    $ownerDetails = $provider->getResourceOwner($this->accessToken);
    Severity: Minor
    Found in src/Facebook.php - About 1 hr to fix

      Method getData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      public function getData(array $options): Result
      {
      $provider = $this->getProvider();
       
      $ownerDetails = $provider->getResourceOwner($this->accessToken);
      Severity: Minor
      Found in src/GooglePlus.php - About 1 hr to fix

        Method getFriends has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        public function getFriends(): array
        {
        if (! $this->accessToken) {
        throw new ExternalLoginServiceException("Access token not provided");
        }
        Severity: Minor
        Found in src/Facebook.php - About 1 hr to fix

          Method getData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          public function getData(array $options): Result
          {
          $provider = $this->getProvider();
           
          if (isset($options['language'])) {
          Severity: Minor
          Found in src/Vk.php - About 1 hr to fix

            Method getData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            public function getData(array $options): Result
            {
            $clientIDs = preg_split("/[[:space:]]+/isu", $this->options['clientId']);
             
            foreach ($clientIDs as $clientID) {
            Severity: Minor
            Found in src/Google.php - About 1 hr to fix

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

              public function getData(array $options): Result
              {
              $provider = $this->getProvider();
               
              $ownerDetails = $provider->getResourceOwner($this->accessToken);
              Severity: Minor
              Found in src/Facebook.php - About 1 hr to fix

              Function getData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              public function getData(array $options): Result
              {
              $clientIDs = preg_split("/[[:space:]]+/isu", $this->options['clientId']);
               
              foreach ($clientIDs as $clientID) {
              Severity: Minor
              Found in src/Google.php - About 55 mins to fix

              Function getFriends has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              public function getFriends(): array
              {
              $cursor = - 1;
              $friendsId = [];
              $count = 1000;
              Severity: Minor
              Found in src/Twitter.php - About 55 mins to fix

              Avoid classes with short names like Vk. Configured minimum length is 3.
              Open

              class Vk extends AbstractLeagueOAuth2
              {
              protected function createProvider(): VkProvider
              {
              return new VkProvider([
              Severity: Minor
              Found in src/Vk.php by phpmd

              Function getData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              public function getData(array $options): Result
              {
              $provider = $this->getProvider();
               
              if (isset($options['language'])) {
              Severity: Minor
              Found in src/Vk.php - About 45 mins to fix

              Avoid unused parameters such as '$params'.
              Open

              public function callback(array $params): array
              Severity: Minor
              Found in src/Google.php by phpmd

              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

              Avoid using static access to class '\Laminas\Uri\UriFactory' in method 'removeSizeParam'.
              Open

              $uri = UriFactory::factory($url);
              Severity: Minor
              Found in src/GooglePlus.php by phpmd

              Avoid using static access to class '\Laminas\Json\Json' in method 'getFriends'.
              Open

              $response = Json\Json::decode($response);
              Severity: Minor
              Found in src/Facebook.php by phpmd

              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

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

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

              The method getData() has an NPath complexity of 972. The configured NPath complexity threshold is 200.
              Open

              public function getData(array $options): Result
              {
              $provider = $this->getProvider();
               
              if (isset($options['language'])) {
              Severity: Minor
              Found in src/Vk.php by phpmd
              Severity
              Category
              Status
              Source
              Language