eveseat/eveapi

View on GitHub

Showing 440 of 440 total issues

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

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

        $start = now();
Severity: Minor
Found in src/Jobs/Assets/Character/Assets.php - About 1 hr to fix

    Method getMoonIndicatorsAttribute has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getMoonIndicatorsAttribute()
        {
            if (is_null($this->moon_indicators)) {
                $this->moon_indicators = (object) [
                    'ubiquitous' => $this->moon_content->filter(function ($type) {
    Severity: Minor
    Found in src/Models/Sde/MapDenormalize.php - About 1 hr to fix

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

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

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

            public function handle()
            {
                parent::handle();
        
                $customs_offices = CorporationCustomsOffice::where('corporation_id', $this->getCorporationId())->get();

          Method submitJobs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function submitJobs(?RefreshToken $token = null)
              {
                  // sort by whether it is a citadel or station
                  [$stations, $citadels] = collect($this->structures)
                      ->keys()
          Severity: Minor
          Found in src/Jobs/Universe/Structures/StructureBatch.php - About 1 hr to fix

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

                public function handle()
                {
                    Bus::batch([
                        new PricesJob(),
                        new DispatchHistoryJobs(),
            Severity: Minor
            Found in src/Commands/Esi/Update/Prices.php - About 1 hr to fix

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

                  public function handle()
                  {
                      parent::handle();
              
                      $response = $this->retrieve([
              Severity: Minor
              Found in src/Jobs/Fittings/Character/Fittings.php - About 1 hr to fix

                Method toEve has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function toEve()
                    {
                        return sprintf('[%s, %s]', $this->type->typeName, $this->info->name) . PHP_EOL .
                
                            $this->low_slots->map(function ($slot) {
                Severity: Minor
                Found in src/Models/Corporation/CorporationStructure.php - About 1 hr to fix

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

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

                    Method enqueueDetailedCorporationContractsJobs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function enqueueDetailedCorporationContractsJobs(array $contract_ids)
                        {
                            CorporationContract::whereIn('contract_id', $contract_ids)
                                ->whereHas('detail', function ($query) {
                                    $query->where('status', '<>', 'deleted');
                    Severity: Minor
                    Found in src/Commands/Esi/Update/Contracts.php - About 1 hr to fix

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

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

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

                                        collect($role->old_roles)->each(function ($role_id) use ($role) {
                        
                                            CorporationRoleHistory::firstOrNew([
                                                'corporation_id' => $this->getCorporationId(),
                                                'character_id' => $role->character_id,
                        Severity: Major
                        Found in src/Jobs/Corporation/RoleHistories.php and 1 other location - About 1 hr to fix
                        src/Jobs/Corporation/RoleHistories.php on lines 106..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 103.

                        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

                                        collect($role->new_roles)->each(function ($role_id) use ($role) {
                        
                                            CorporationRoleHistory::firstOrNew([
                                                'corporation_id' => $this->getCorporationId(),
                                                'character_id' => $role->character_id,
                        Severity: Major
                        Found in src/Jobs/Corporation/RoleHistories.php and 1 other location - About 1 hr to fix
                        src/Jobs/Corporation/RoleHistories.php on lines 91..104

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

                        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 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

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

                              public function handle()
                              {
                          
                                  $this->line('SeAT Token Upgrader');
                          
                          
                          Severity: Minor
                          Found in src/Commands/Seat/Tokens/Upgrade.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 handle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function handle()
                              {
                                  while (true) {
                          
                                      $response = $this->retrieve([
                          Severity: Minor
                          Found in src/Jobs/Killmails/Character/Recent.php - About 1 hr to fix

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

                                public function handle()
                                {
                                    parent::handle();
                            
                                    // Perform a journal walk backwards to get all of the
                            Severity: Minor
                            Found in src/Jobs/Wallet/Character/Transactions.php - About 1 hr to fix

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

                                  public function handle()
                                  {
                                      parent::handle();
                              
                                      $response = $this->retrieve([
                              Severity: Minor
                              Found in src/Jobs/Skills/Character/Skills.php - About 1 hr to fix

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

                                    private function addCommands()
                                    {
                                        $this->commands([
                                            // Buckets
                                            \Seat\Eveapi\Commands\Seat\Buckets\Info::class,
                                Severity: Minor
                                Found in src/EveapiServiceProvider.php - About 1 hr to fix

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

                                      public function handle()
                                      {
                                          while (true) {
                                  
                                              $response = $this->retrieve([
                                  Severity: Minor
                                  Found in src/Jobs/Killmails/Corporation/Recent.php - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language