eveseat/eseye

View on GitHub
src/Fetchers/GuzzleFetcher.php

Summary

Maintainability
A
3 hrs
Test Coverage
A
90%

Method httpRequest has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function httpRequest(
        string $method, string $uri, array $headers = [], array $body = []): EsiResponse
    {

        // Include some basic headers to those already passed in. Everything
Severity: Minor
Found in src/Fetchers/GuzzleFetcher.php - About 1 hr to fix

    Method refreshToken has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function refreshToken()
        {
    
            // Make the post request for a new access_token
            try {
    Severity: Minor
    Found in src/Fetchers/GuzzleFetcher.php - About 1 hr to fix

      The class GuzzleFetcher has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13.
      Open

      class GuzzleFetcher implements FetcherInterface
      {
      
          /**
           * @var string
      Severity: Minor
      Found in src/Fetchers/GuzzleFetcher.php by phpmd

      CouplingBetweenObjects

      Since: 1.1.0

      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

      Example

      class Foo {
          /**
           * @var \foo\bar\X
           */
          private $x = null;
      
          /**
           * @var \foo\bar\Y
           */
          private $y = null;
      
          /**
           * @var \foo\bar\Z
           */
          private $z = null;
      
          public function setFoo(\Foo $foo) {}
          public function setBar(\Bar $bar) {}
          public function setBaz(\Baz $baz) {}
      
          /**
           * @return \SplObjectStorage
           * @throws \OutOfRangeException
           * @throws \InvalidArgumentException
           * @throws \ErrorException
           */
          public function process(\Iterator $it) {}
      
          // ...
      }

      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

      Avoid using static access to class '\Jose\Component\Core\JWKSet' in method 'verifyToken'.
      Open

              $jwk_sets = JWKSet::createFromKeyData($sets);
      Severity: Minor
      Found in src/Fetchers/GuzzleFetcher.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

      There are no issues that match your filters.

      Category
      Status