eveseat/eveapi

View on GitHub

Showing 440 of 440 total issues

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

        CharacterAsset::join('invTypes', 'type_id', '=', 'typeID')
            ->join('invGroups', 'invGroups.groupID', '=', 'invTypes.groupID')
            ->where('character_id', $this->getCharacterId())
            ->where('is_singleton', true) // only singleton items may be named
            ->whereIn('categoryID', [ // It seems like only items from these categories can be named
Severity: Major
Found in src/Jobs/Assets/Character/Names.php and 1 other location - About 3 hrs to fix
src/Jobs/Assets/Corporation/Names.php on lines 86..119

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 144.

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

<?php

/*
 * This file is part of SeAT
 *
Severity: Major
Found in src/Jobs/Character/Info.php and 1 other location - About 3 hrs to fix
src/Jobs/Corporation/Info.php on lines 1..83

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 142.

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

<?php

/*
 * This file is part of SeAT
 *
Severity: Major
Found in src/Jobs/Corporation/Info.php and 1 other location - About 3 hrs to fix
src/Jobs/Character/Info.php on lines 1..84

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 142.

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

CorporationStructure has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

#[OA\Schema(
    title: 'CorporationStructure',
    description: 'Corporation Structure',
    properties: [
        new OA\Property(property: 'structure_id', description: 'Structure unique identifier', type: 'integer', format: 'int64'),
Severity: Minor
Found in src/Models/Corporation/CorporationStructure.php - About 2 hrs to fix

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

        public function handle()
        {
            if ($this->batchId && $this->batch()->cancelled()) {
                logger()->debug(sprintf('[Jobs][%s] Orders - Cancelling job due to relevant batch %s cancellation.', $this->job->getJobId(), $this->batch()->id));
    
    
    Severity: Major
    Found in src/Jobs/Market/History.php - About 2 hrs to fix

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

          public function handle()
          {
      
              $this->line('SeAT Token Upgrader');
      
      
      Severity: Major
      Found in src/Commands/Seat/Tokens/Upgrade.php - About 2 hrs to fix

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

            public function handle()
            {
        
                // Start by warning the user about the command that will be run
                $this->comment('Warning! This Laravel command uses exec() to execute a ');
        Severity: Minor
        Found in src/Commands/Eve/Update/Sde.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 handle has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function handle()
            {
                parent::handle();
        
                while (true) {
        Severity: Major
        Found in src/Jobs/Corporation/Structures.php - About 2 hrs to fix

          File PlanetDetail.php has 262 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /*
           * This file is part of SeAT
           *
          Severity: Minor
          Found in src/Jobs/PlanetaryInteraction/Character/PlanetDetail.php - About 2 hrs to fix

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

            <?php
            
            /*
             * This file is part of SeAT
             *
            Severity: Major
            Found in src/Models/Skills/CharacterAttribute.php and 1 other location - About 2 hrs to fix
            src/Models/Sovereignty/SovereigntyStructure.php on lines 1..64

            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 125.

            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

            <?php
            
            /*
             * This file is part of SeAT
             *
            Severity: Major
            Found in src/Models/Sovereignty/SovereigntyStructure.php and 1 other location - About 2 hrs to fix
            src/Models/Skills/CharacterAttribute.php on lines 1..65

            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 125.

            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

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

                public function handle()
                {
                    $response = $this->retrieve([
                        'killmail_id' => $this->killmail_id,
                        'killmail_hash' => $this->killmail_hash,
            Severity: Major
            Found in src/Jobs/Killmails/Detail.php - About 2 hrs to fix

              File CorporationInfo.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /*
               * This file is part of SeAT
               *
              Severity: Minor
              Found in src/Models/Corporation/CorporationInfo.php - About 2 hrs to fix

                File CharacterInfo.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /*
                 * This file is part of SeAT
                 *
                Severity: Minor
                Found in src/Models/Character/CharacterInfo.php - About 2 hrs to fix

                  Method customValidationMessages has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function customValidationMessages()
                      {
                          return [
                              '0.integer' => self::INTEGER_VALIDATION_MESSAGE,
                              '0.between' => self::BETWEEN_VALIDATION_MESSAGE,
                  Severity: Major
                  Found in src/Mapping/Sde/StaStationMapping.php - About 2 hrs to fix

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

                            collect($orders)->each(function ($order) use ($structure_batch) {
                                $structure_batch->addStructure($order->location_id);
                    
                                $model = CharacterOrder::firstOrNew([
                                    'character_id' => $this->getCharacterId(),
                    Severity: Major
                    Found in src/Jobs/Market/Character/Orders.php and 2 other locations - About 1 hr to fix
                    src/Jobs/Industry/Character/Jobs.php on lines 85..101
                    src/Jobs/Industry/Corporation/Jobs.php on lines 100..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 120.

                    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 3 locations. Consider refactoring.
                    Open

                                collect($industry_jobs)->each(function ($job) use ($structure_batch) {
                                    $structure_batch->addStructure($job->location_id);
                    
                                    $model = CorporationIndustryJob::firstOrNew([
                                        'corporation_id' => $this->getCorporationId(),
                    Severity: Major
                    Found in src/Jobs/Industry/Corporation/Jobs.php and 2 other locations - About 1 hr to fix
                    src/Jobs/Industry/Character/Jobs.php on lines 85..101
                    src/Jobs/Market/Character/Orders.php on lines 79..95

                    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 120.

                    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 3 locations. Consider refactoring.
                    Open

                            collect($industry_jobs)->each(function ($job) use ($structure_batch) {
                                $structure_batch->addStructure($job->facility_id);
                    
                                $model = CharacterIndustryJob::firstOrNew([
                                    'character_id' => $this->getCharacterId(),
                    Severity: Major
                    Found in src/Jobs/Industry/Character/Jobs.php and 2 other locations - About 1 hr to fix
                    src/Jobs/Industry/Corporation/Jobs.php on lines 100..116
                    src/Jobs/Market/Character/Orders.php on lines 79..95

                    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 120.

                    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

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

                        public function handle()
                        {
                            $job_start_time = now();
                    
                            // the region_id cached to speed up execution of the loop
                    Severity: Minor
                    Found in src/Jobs/Market/Orders.php - About 1 hr to fix

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

                          public function handle()
                          {
                              parent::handle();
                      
                              CorporationWalletBalance::where('corporation_id', $this->getCorporationId())->get()
                      Severity: Minor
                      Found in src/Jobs/Wallet/Corporation/Journals.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language