seatplus/eveapi

View on GitHub

Showing 4 of 138 total issues

File CheckJobsCommand.php has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

<?php

/*
 * MIT License
 *
Severity: Minor
Found in src/Commands/CheckJobsCommand.php - About 2 hrs to fix

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

        public function handle()
        {
            if ($this->batch()->cancelled()) {
                // Determine if the batch has been cancelled...
    
    
    Severity: Minor
    Found in src/Jobs/Hydrate/Maintenance/GetMissingLocationFromContracts.php - About 1 hr to fix

      Function handleException has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          private function handleException(RequestFailedException $exception)
          {
              // If error is in 4xx or 5xx range increase esi rate limit
              if (($exception->getOriginalException()->getCode() >= 400) && ($exception->getOriginalException()->getCode() <= 599)) {
                  $this->incrementEsiRateLimit();
      Severity: Minor
      Found in src/Services/Esi/RetrieveEsiData.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 persist has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Confirmed

          private function persist(Collection $contracts)
          {
              Contract::upsert(
                  $contracts->toArray(),
                  ['contract_id'],
      Severity: Minor
      Found in src/Jobs/Contracts/CharacterContractsJob.php - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language