Showing 479 of 479 total issues

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

<?php

/*
 * This file is part of SeAT
 *
Severity: Major
Found in src/Observers/CharacterSkillObserver.php and 2 other locations - About 2 hrs to fix
src/Observers/CharacterAssetObserver.php on lines 1..72
src/Observers/CharacterTitleObserver.php on lines 1..72

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

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

        return datatables()
            ->eloquent($this->applyScopes($this->query()))
            ->editColumn('action', function ($row) {
                return view('web::common.contracts.buttons.details', compact('row'))->render();
            })
src/Http/DataTables/Common/Financial/AbstractContractDataTable.php on lines 42..125

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

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

    public function update(Request $request, Role $role)
    {
        $request->validate([
            'title' => 'string|required',
            'description' => 'string|nullable',
Severity: Major
Found in src/Http/Controllers/Configuration/AccessController.php - About 2 hrs to fix

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

        public function ajax()
        {
            return datatables()
                ->eloquent($this->applyScopes($this->query()))
                ->editColumn('start_date', function ($row) {
    Severity: Major
    Found in src/Http/DataTables/Common/Industrial/AbstractIndustryDataTable.php - About 2 hrs to fix

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

              return datatables()
                  ->eloquent($this->applyScopes($this->query()))
                  ->editColumn('character.name', function ($row) {
                      return view('web::partials.character', ['character' => $row->character])->render();
                  })
      src/Http/DataTables/Common/Financial/AbstractWalletTransactionDataTable.php on lines 41..54

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

      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

      Squad has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Squad extends Model
      {
          use Filterable;
      
          /**
      Severity: Minor
      Found in src/Models/Squads/Squad.php - About 2 hrs to fix

        WebServiceProvider has 24 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class WebServiceProvider extends AbstractSeatPlugin
        {
            /**
             * Bootstrap the application services.
             *
        Severity: Minor
        Found in src/WebServiceProvider.php - About 2 hrs to fix

          File WebServiceProvider.php has 277 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

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

            Method ajax has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function ajax()
                {
                    return datatables()
                        ->eloquent($this->applyScopes($this->query()))
                        ->editColumn('action', function ($row) {
            Severity: Major
            Found in src/Http/DataTables/Common/Military/AbstractKillMailDataTable.php - About 2 hrs to fix

              Method getEntities has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getEntities(Request $request)
                  {
              
                      $this->validate($request, [
                          'type' => 'in:characters,corporations,alliances',
              Severity: Major
              Found in src/Http/Controllers/Support/FastLookupController.php - About 2 hrs to fix

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

                        return DataTables::of($top)
                            ->editColumn('ref_type', function ($row) {
                
                                return ucwords(str_replace('_', ' ', $row->ref_type));
                            })
                Severity: Major
                Found in src/Http/Controllers/Character/IntelController.php and 1 other location - About 2 hrs to fix
                src/Http/Controllers/Character/IntelController.php on lines 157..171

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

                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

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

                        return DataTables::of($top)
                            ->editColumn('entity_name', function ($row) {
                                if($row->category == 'character') {
                                    $character = (object) ['character_id' => $row->party_id, 'name' => $row->party_name];
                
                
                Severity: Major
                Found in src/Http/Controllers/Character/IntelController.php and 1 other location - About 2 hrs to fix
                src/Http/Controllers/Character/IntelController.php on lines 89..108

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

                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

                        return DataTables::of($mail)
                            ->editColumn('sender.name', function ($row) {
                                switch ($row->sender->category) {
                                    case 'character':
                                        return view('web::partials.character', ['character' => $row->sender]);
                Severity: Major
                Found in src/Http/Controllers/Character/IntelController.php and 1 other location - About 2 hrs to fix
                src/Http/Controllers/Character/IntelController.php on lines 397..437

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

                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

                        return DataTables::of($transactions)
                            ->editColumn('date', function ($row) {
                                return view('web::partials.date', ['datetime' => $row->date]);
                            })
                            ->editColumn('is_buy', function ($row) {
                Severity: Major
                Found in src/Http/Controllers/Character/IntelController.php and 1 other location - About 2 hrs to fix
                src/Http/Controllers/Character/IntelController.php on lines 471..485

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

                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

                Identical blocks of code found in 7 locations. Consider refactoring.
                Open

                        $map = $permissions->map(function ($permission) {
                            $filters = json_decode($permission->pivot->filters);
                
                            return [
                                'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                Severity: Major
                Found in src/Http/DataTables/Scopes/KillMailCharacterScope.php and 6 other locations - About 2 hrs to fix
                src/Http/Controllers/Character/MailController.php on lines 160..168
                src/Http/DataTables/Scopes/CharacterMailScope.php on lines 90..98
                src/Http/DataTables/Scopes/CharacterNoteScope.php on lines 87..95
                src/Http/DataTables/Scopes/CharacterScope.php on lines 103..111
                src/Http/Validation/StandingsExistingElementAdd.php on lines 110..118
                src/Http/Validation/StandingsExistingElementAdd.php on lines 159..167

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

                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

                Identical blocks of code found in 7 locations. Consider refactoring.
                Open

                        $map = $permissions->map(function ($permission) {
                            $filters = json_decode($permission->pivot->filters);
                
                            return [
                                'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                Severity: Major
                Found in src/Http/DataTables/Scopes/CharacterScope.php and 6 other locations - About 2 hrs to fix
                src/Http/Controllers/Character/MailController.php on lines 160..168
                src/Http/DataTables/Scopes/CharacterMailScope.php on lines 90..98
                src/Http/DataTables/Scopes/CharacterNoteScope.php on lines 87..95
                src/Http/DataTables/Scopes/KillMailCharacterScope.php on lines 95..103
                src/Http/Validation/StandingsExistingElementAdd.php on lines 110..118
                src/Http/Validation/StandingsExistingElementAdd.php on lines 159..167

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

                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

                Identical blocks of code found in 7 locations. Consider refactoring.
                Open

                        $map = $permissions->map(function ($permission) {
                            $filters = json_decode($permission->pivot->filters);
                
                            return [
                                'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                Severity: Major
                Found in src/Http/Validation/StandingsExistingElementAdd.php and 6 other locations - About 2 hrs to fix
                src/Http/Controllers/Character/MailController.php on lines 160..168
                src/Http/DataTables/Scopes/CharacterMailScope.php on lines 90..98
                src/Http/DataTables/Scopes/CharacterNoteScope.php on lines 87..95
                src/Http/DataTables/Scopes/CharacterScope.php on lines 103..111
                src/Http/DataTables/Scopes/KillMailCharacterScope.php on lines 95..103
                src/Http/Validation/StandingsExistingElementAdd.php on lines 159..167

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

                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

                Identical blocks of code found in 7 locations. Consider refactoring.
                Open

                        $map = $permissions->map(function ($permission) {
                            $filters = json_decode($permission->pivot->filters);
                
                            return [
                                'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                Severity: Major
                Found in src/Http/Validation/StandingsExistingElementAdd.php and 6 other locations - About 2 hrs to fix
                src/Http/Controllers/Character/MailController.php on lines 160..168
                src/Http/DataTables/Scopes/CharacterMailScope.php on lines 90..98
                src/Http/DataTables/Scopes/CharacterNoteScope.php on lines 87..95
                src/Http/DataTables/Scopes/CharacterScope.php on lines 103..111
                src/Http/DataTables/Scopes/KillMailCharacterScope.php on lines 95..103
                src/Http/Validation/StandingsExistingElementAdd.php on lines 110..118

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

                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

                Identical blocks of code found in 7 locations. Consider refactoring.
                Open

                                $map = $permissions->map(function ($permission) {
                                    $filters = json_decode($permission->pivot->filters);
                
                                    return [
                                        'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                Severity: Major
                Found in src/Http/Controllers/Character/MailController.php and 6 other locations - About 2 hrs to fix
                src/Http/DataTables/Scopes/CharacterMailScope.php on lines 90..98
                src/Http/DataTables/Scopes/CharacterNoteScope.php on lines 87..95
                src/Http/DataTables/Scopes/CharacterScope.php on lines 103..111
                src/Http/DataTables/Scopes/KillMailCharacterScope.php on lines 95..103
                src/Http/Validation/StandingsExistingElementAdd.php on lines 110..118
                src/Http/Validation/StandingsExistingElementAdd.php on lines 159..167

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

                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

                Identical blocks of code found in 7 locations. Consider refactoring.
                Open

                        $map = $permissions->map(function ($permission) {
                            $filters = json_decode($permission->pivot->filters);
                
                            return [
                                'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                Severity: Major
                Found in src/Http/DataTables/Scopes/CharacterNoteScope.php and 6 other locations - About 2 hrs to fix
                src/Http/Controllers/Character/MailController.php on lines 160..168
                src/Http/DataTables/Scopes/CharacterMailScope.php on lines 90..98
                src/Http/DataTables/Scopes/CharacterScope.php on lines 103..111
                src/Http/DataTables/Scopes/KillMailCharacterScope.php on lines 95..103
                src/Http/Validation/StandingsExistingElementAdd.php on lines 110..118
                src/Http/Validation/StandingsExistingElementAdd.php on lines 159..167

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

                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

                Severity
                Category
                Status
                Source
                Language