eveseat/services

View on GitHub

Showing 21 of 106 total issues

Function parse has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse(string $report)
    {
        $lines = explode($this->line_delimiter, $report);

        foreach ($lines as $line)
Severity: Minor
Found in src/ReportParser/ReportParser.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 boot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function boot()
    {

        // If we are in debug mode, listen to database events
        // and log queries to the log file.
Severity: Minor
Found in src/ServicesServiceProvider.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 getPackageLatestVersion has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getPackageLatestVersion(string $vendor, string $package): string
    {
        // construct the packagist uri to its API
        $packagist_url = sprintf('https://packagist.org/packages/%s/%s.json',
            $vendor, $package);
Severity: Minor
Found in src/Traits/VersionsManagementTrait.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 validate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate()
    {
        if ($this->isEmpty())
            throw new EmptyReportException();

Severity: Minor
Found in src/ReportParser/Parsers/MoonReport.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

Method evemail_threads has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function evemail_threads($message)
    {

        // Explode the messages based on the delimiter added
        // by the EVE Online Client.
Severity: Minor
Found in src/Helpers/helpers.php - About 1 hr to fix

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

        public function __construct(string $type, string $variation, ?int $id, int $size, array $attr = [], bool $lazy = true)
        {
            // Validate the arguments
            if (! in_array($type, $this->known_types))
                throw new EveImageException($type . ' is not a valid image type.');
    Severity: Minor
    Found in src/Image/Eve.php - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

              if ($id > 90000000 && $id < 98000000)
                  return 'characters';
      
              elseif (($id > 98000000 && $id < 99000000) || ($id > 1000000 && $id < 2000000))
                  return 'corporations';
      Severity: Critical
      Found in src/Image/Eve.php - About 1 hr to fix

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

            public function __construct(string $type, string $variation, ?int $id, int $size, array $attr = [], bool $lazy = true)
            {
                // Validate the arguments
                if (! in_array($type, $this->known_types))
                    throw new EveImageException($type . ' is not a valid image type.');
        Severity: Minor
        Found in src/Image/Eve.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 number_roman has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            function number_roman($number)
            {
        
                $map = [
                    'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50,
        Severity: Minor
        Found in src/Helpers/helpers.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 setting has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            function setting($name, bool $global = false)
            {
        
                // If we received an array, it means we want to set.
                if (is_array($name)) {
        Severity: Minor
        Found in src/Helpers/helpers.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

        Method getPackageLatestVersion has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function getPackageLatestVersion(string $vendor, string $package): string
            {
                // construct the packagist uri to its API
                $packagist_url = sprintf('https://packagist.org/packages/%s/%s.json',
                    $vendor, $package);
        Severity: Minor
        Found in src/Traits/VersionsManagementTrait.php - About 1 hr to fix

          Method parse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function parse(string $report)
              {
                  $lines = explode($this->line_delimiter, $report);
          
                  foreach ($lines as $line)
          Severity: Minor
          Found in src/ReportParser/ReportParser.php - About 1 hr to fix

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

                public function html()
                {
            
                    // make new IMG tag
                    $html = '<img ';
            Severity: Minor
            Found in src/Image/Eve.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 detect_type has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function detect_type($id)
                {
                    if ($id === null)
                        return 'unknown';
            
            
            Severity: Minor
            Found in src/Image/Eve.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

            Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function __construct(string $type, string $variation, ?int $id, int $size, array $attr = [], bool $lazy = true)
            Severity: Minor
            Found in src/Image/Eve.php - About 45 mins to fix

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

                  public function __get($key)
                  {
                      // fetch injected relations
                      $extension_registry = app()->make(InjectedRelationRegistry::class);
                      $extension_class = $extension_registry->getExtensionClassFor($this::class, $key);
              Severity: Minor
              Found in src/Models/ExtensibleModel.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

              Method img has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  function img(string $type, string $variation, ?int $id, int $size, array $attr = [], $lazy = true)
              Severity: Minor
              Found in src/Helpers/helpers.php - About 45 mins to fix

                Function getPluginsMetadataList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function getPluginsMetadataList(): stdClass
                    {
                        app()->loadDeferredProviders();
                        $providers = array_keys(app()->getLoadedProviders());
                
                
                Severity: Minor
                Found in src/Traits/VersionsManagementTrait.php - About 35 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

                Avoid too many return statements within this method.
                Open

                        return $installed_version;
                Severity: Major
                Found in src/Traits/VersionsManagementTrait.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return 'characters';
                  Severity: Major
                  Found in src/Image/Eve.php - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language