eveseat/eveapi

View on GitHub

Showing 440 of 440 total issues

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

    public function handle()
    {
        parent::handle();

        while (true) {
Severity: Minor
Found in src/Jobs/Market/Character/History.php - About 1 hr to fix

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

        public function handle()
        {
            parent::handle();
    
            while (true) {
    Severity: Minor
    Found in src/Jobs/Contacts/Character/Contacts.php - About 1 hr to fix

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

          public function handle()
          {
              parent::handle();
      
              CorporationIndustryMiningObserver::where('corporation_id', $this->getCorporationId())
      Severity: Minor
      Found in src/Jobs/Industry/Corporation/Mining/ObserverDetails.php - About 1 hr to fix

        Method fromEsi has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function fromEsi($esi_structure): ContractDetail
            {
                $this->fill([
                    'issuer_id' => $esi_structure->issuer_id,
                    'issuer_corporation_id' => $esi_structure->issuer_corporation_id,
        Severity: Minor
        Found in src/Models/Contracts/ContractDetail.php - About 1 hr to fix

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

              public function handle()
              {
                  parent::handle();
          
                  $structure_batch = new StructureBatch();
          Severity: Minor
          Found in src/Jobs/Industry/Corporation/Jobs.php - About 1 hr to fix

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

                public function handle()
                {
                    parent::handle();
            
                    $structure_batch = new StructureBatch();
            Severity: Minor
            Found in src/Jobs/Corporation/ContainerLogs.php - About 1 hr to fix

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

                  public function handle(EsiBase $job, Closure $next): void
                  {
                      // bypass control if the class is not related to ESI or is the ESI ping job
                      if ($job instanceof Esi) {
                          logger()->debug(
              Severity: Minor
              Found in src/Jobs/Middleware/CheckEsiRouteStatus.php - About 1 hr to fix

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    private function cleanRoutes()
                    {
                        // retrieve all routes which have not been returned by API.
                        // We will run a delete statement on those selected rows in order to avoid any deadlock.
                        $existing_routes = CharacterPlanetRoute::where('character_id', $this->getCharacterId())
                Severity: Major
                Found in src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php and 3 other locations - About 1 hr to fix
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 431..444
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 449..462
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 467..480

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 100.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    private function cleanPins()
                    {
                        // retrieve all pins which have not been returned by API.
                        // We will run a delete statement on those selected rows in order to avoid any deadlock.
                        $existing_pins = CharacterPlanetPin::where('character_id', $this->getCharacterId())
                Severity: Major
                Found in src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php and 3 other locations - About 1 hr to fix
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 361..374
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 431..444
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 449..462

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 100.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    private function cleanExtractors()
                    {
                        // retrieve all extractors which have not been returned by API.
                        // We will run a delete statement on those selected rows in order to avoid any deadlock.
                        $existing_extractors = CharacterPlanetExtractor::where('character_id', $this->getCharacterId())
                Severity: Major
                Found in src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php and 3 other locations - About 1 hr to fix
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 361..374
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 449..462
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 467..480

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 100.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                    private function cleanFactories()
                    {
                        // retrieve all factories which have not been returned by API.
                        // We will run a delete statement on those selected rows in order to avoid any deadlock.
                        $existing_factories = CharacterPlanetFactory::where('character_id', $this->getCharacterId())
                Severity: Major
                Found in src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php and 3 other locations - About 1 hr to fix
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 361..374
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 431..444
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 467..480

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 100.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                    private function handleEsiFailedCall(RequestFailedException $exception)
                    {
                        // increment ESI rate limit
                        $this->incrementEsiRateLimit();
                
                
                Severity: Minor
                Found in src/Jobs/EsiBase.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 check_storage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function check_storage()
                    {
                
                        $this->line(' * Checking storage');
                
                
                Severity: Minor
                Found in src/Commands/Seat/Admin/Diagnose.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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    public function rules(): array
                    {
                        return [
                            '0' => 'integer|between:60000000,64000000|required',
                            '1' => 'numeric|between:-1,1|required',
                Severity: Minor
                Found in src/Mapping/Sde/StaStationMapping.php and 1 other location - About 55 mins to fix
                src/Mapping/Sde/StaStationMapping.php on lines 94..116

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 98.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    public function customValidationAttributes()
                    {
                        return [
                            '0' => 'stationID',
                            '1' => 'security',
                Severity: Minor
                Found in src/Mapping/Sde/StaStationMapping.php and 1 other location - About 55 mins to fix
                src/Mapping/Sde/StaStationMapping.php on lines 70..92

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 98.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    private function cleanLinks()
                    {
                        // retrieve all links which have not been returned by API.
                        // We will run a delete statement on those selected rows in order to avoid any deadlock.
                        $this->planet_links->groupBy('source_pin_id')->each(function ($links) {
                Severity: Minor
                Found in src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php and 1 other location - About 50 mins to fix
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 343..356

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    private function cleanRouteWaypoints()
                    {
                        // retrieve all waypoints which have not been returned by API.
                        // We will run a delete statement on those selected rows in order to avoid any deadlock.
                        $this->planet_waypoints->groupBy('route_id')->each(function ($pins) {
                Severity: Minor
                Found in src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php and 1 other location - About 50 mins to fix
                src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php on lines 379..392

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Avoid variables with short names like $z. Configured minimum length is 3.
                Open

                    public function find_nearest_celestial(int $solar_system_id, float $x, float $y, float $z, ?int $group = null): array
                Severity: Minor
                Found in src/Traits/Utils.php by phpmd

                ShortVariable

                Since: 0.2

                Detects when a field, local, or parameter has a very short name.

                Example

                class Something {
                    private $q = 15; // VIOLATION - Field
                    public static function main( array $as ) { // VIOLATION - Formal
                        $r = 20 + $this->q; // VIOLATION - Local
                        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                            $r += $this->q;
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#shortvariable

                Avoid variables with short names like $y. Configured minimum length is 3.
                Open

                    public function find_nearest_celestial(int $solar_system_id, float $x, float $y, float $z, ?int $group = null): array
                Severity: Minor
                Found in src/Traits/Utils.php by phpmd

                ShortVariable

                Since: 0.2

                Detects when a field, local, or parameter has a very short name.

                Example

                class Something {
                    private $q = 15; // VIOLATION - Field
                    public static function main( array $as ) { // VIOLATION - Formal
                        $r = 20 + $this->q; // VIOLATION - Local
                        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                            $r += $this->q;
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#shortvariable

                Avoid variables with short names like $x. Configured minimum length is 3.
                Open

                    public function find_nearest_celestial(int $solar_system_id, float $x, float $y, float $z, ?int $group = null): array
                Severity: Minor
                Found in src/Traits/Utils.php by phpmd

                ShortVariable

                Since: 0.2

                Detects when a field, local, or parameter has a very short name.

                Example

                class Something {
                    private $q = 15; // VIOLATION - Field
                    public static function main( array $as ) { // VIOLATION - Formal
                        $r = 20 + $this->q; // VIOLATION - Local
                        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                            $r += $this->q;
                        }
                    }
                }

                Source https://phpmd.org/rules/naming.html#shortvariable

                Severity
                Category
                Status
                Source
                Language