eveseat/eseye

View on GitHub

Showing 57 of 57 total issues

Method new_login has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function new_login()
{

    $action = $_SERVER['PHP_SELF'] . '?action=submitsecrets';
    $callback = get_sso_callback_url();
Severity: Major
Found in bin/index.php - About 5 hrs to fix

    The class Eseye has an overall complexity of 50 which is very high. The configured complexity threshold is 50.
    Open

    class Eseye
    {
    
        /**
         * The Eseye Version.
    Severity: Minor
    Found in src/Eseye.php by phpmd

    Eseye has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Eseye
    {
    
        /**
         * The Eseye Version.
    Severity: Minor
    Found in src/Eseye.php - About 3 hrs to fix

      File index.php has 276 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /*
       * This file is part of SeAT
       *
      Severity: Minor
      Found in bin/index.php - About 2 hrs to fix

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

            public function invoke(string $method, string $uri, array $uri_data = []): EsiResponse
            {
        
                // Check the Access Requirement
                if (! $this->getAccessChecker()->can(
        Severity: Minor
        Found in src/Eseye.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

        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

            Method invoke has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function invoke(string $method, string $uri, array $uri_data = []): EsiResponse
                {
            
                    // Check the Access Requirement
                    if (! $this->getAccessChecker()->can(
            Severity: Minor
            Found in src/Eseye.php - About 1 hr to fix

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

                  public function __construct($instance = null)
                  {
              
                      if ($instance != null)
                          $this->memcached = $instance;
              Severity: Minor
              Found in src/Cache/MemcachedCache.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

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

                  private function mapDataToUri(string $uri, array $data): string
                  {
              
                      // Extract fields in curly braces. If there are fields,
                      // replace the data with those in the URI
              Severity: Minor
              Found in src/Eseye.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

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

              class Eseye
              {
              
                  /**
                   * The Eseye Version.
              Severity: Minor
              Found in src/Eseye.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

              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

              Missing class import via use statement (line '77', column '40').
              Open

                              $this->memcached = new \Memcached();
              Severity: Minor
              Found in src/Cache/MemcachedCache.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Remove error control operator '@' on line 75.
              Open

                  public function checkCacheDirectory()
                  {
              
                      // Ensure the cache path exists
                      if (! is_dir($this->cache_path) &&
              Severity: Minor
              Found in src/Cache/FileCache.php by phpmd

              ErrorControlOperator

              Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

              Example

              function foo($filePath) {
                  $file = @fopen($filPath); // hides exceptions
                  $key = @$array[$notExistingKey]; // assigns null to $key
              }

              Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

              Missing class import via use statement (line '79', column '40').
              Open

                              $this->memcached = new \Memcache();
              Severity: Minor
              Found in src/Cache/MemcachedCache.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Remove error control operator '@' on line 116.
              Open

                  public function set(string $uri, string $query, EsiResponse $data)
                  {
              
                      $path = $this->buildRelativePath($this->safePath($uri), $query);
              
              
              Severity: Minor
              Found in src/Cache/FileCache.php by phpmd

              ErrorControlOperator

              Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

              Example

              function foo($filePath) {
                  $file = @fopen($filPath); // hides exceptions
                  $key = @$array[$notExistingKey]; // assigns null to $key
              }

              Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

              The method __construct has a boolean flag argument $protected_header, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public function __construct(array $supported_types, bool $protected_header = true)
              Severity: Minor
              Found in src/Checker/Header/TypeChecker.php by phpmd

              BooleanArgumentFlag

              Since: 1.4.0

              A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

              Example

              class Foo {
                  public function bar($flag = true) {
                  }
              }

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

              Missing class import via use statement (line '37', column '20').
              Open

                      return new \Carbon\Carbon;
              Severity: Minor
              Found in src/Helpers/helpers.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Remove error control operator '@' on line 202.
              Open

                  public function forget(string $uri, string $query = '')
                  {
              
                      $path = $this->buildRelativePath($uri, $query);
                      $cache_file_path = $path . $this->results_filename;
              Severity: Minor
              Found in src/Cache/FileCache.php by phpmd

              ErrorControlOperator

              Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

              Example

              function foo($filePath) {
                  $file = @fopen($filPath); // hides exceptions
                  $key = @$array[$notExistingKey]; // assigns null to $key
              }

              Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

              Missing class import via use statement (line '35', column '24').
              Open

                          return new \Carbon\Carbon($data);
              Severity: Minor
              Found in src/Helpers/helpers.php by phpmd

              MissingImport

              Since: 2.7.0

              Importing all external classes in a file through use statements makes them clearly visible.

              Example

              function make() {
                  return new \stdClass();
              }

              Source http://phpmd.org/rules/cleancode.html#MissingImport

              Severity
              Category
              Status
              Source
              Language