autowp/external-login-service

View on GitHub

Showing 12 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

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

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

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

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

              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

              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

              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

              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

              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

              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

              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

              Severity
              Category
              Status
              Source
              Language