Showing 479 of 479 total issues

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/CharacterMailScope.php and 6 other locations - About 2 hrs to fix
src/Http/Controllers/Character/MailController.php on lines 160..168
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

File sheet.blade.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
Open

@extends('web::character.layouts.view', ['viewname' => 'sheet', 'breadcrumb' => trans('web::seat.sheet')])

@section('page_header', trans_choice('web::seat.character', 1) . ' ' . trans('web::seat.sheet'))

@inject('request', 'Illuminate\Http\Request')
Severity: Minor
Found in src/resources/views/character/sheet.blade.php - About 2 hrs to fix

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

    <?php
    
    /*
     * This file is part of SeAT
     *
    Severity: Major
    Found in src/Http/Controllers/Character/IndustryController.php and 2 other locations - About 2 hrs to fix
    src/Http/Controllers/Character/ContactsController.php on lines 1..52
    src/Http/Controllers/Character/MarketController.php on lines 1..52

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

    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

    <?php
    
    /*
     * This file is part of SeAT
     *
    Severity: Major
    Found in src/Http/Controllers/Character/ContactsController.php and 2 other locations - About 2 hrs to fix
    src/Http/Controllers/Character/IndustryController.php on lines 1..52
    src/Http/Controllers/Character/MarketController.php on lines 1..52

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

    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

    <?php
    
    /*
     * This file is part of SeAT
     *
    Severity: Major
    Found in src/Http/Controllers/Character/MarketController.php and 2 other locations - About 2 hrs to fix
    src/Http/Controllers/Character/ContactsController.php on lines 1..52
    src/Http/Controllers/Character/IndustryController.php on lines 1..52

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

    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($journal)
                ->editColumn('ref_type', function ($row) {
    
                    return view('web::common.wallets.journaltranstype', compact('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 320..358

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

        public function ajax()
        {
            return datatables()
                ->eloquent($this->applyScopes($this->query()))
                ->editColumn('refresh_token.expires_on', function ($row) {
    Severity: Major
    Found in src/Http/DataTables/Corporation/Intel/MembersTrackingDataTable.php - About 2 hrs to fix

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

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

        Method apply has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function apply($query)
            {
                // extract querying table (from)
                $table = $query->getQuery()->from;
        
        
        Severity: Major
        Found in src/Http/DataTables/Scopes/CharacterScope.php - About 2 hrs to fix

          Method getSearchMailData has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getSearchMailData(Request $request)
              {
          
                  $mail = $this->doSearchCharacterMail();
          
          
          Severity: Major
          Found in src/Http/Controllers/Support/SearchController.php - About 2 hrs to fix

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

                public function getTransactionContent(CharacterInfo $character, int $client_id)
                {
            
                    $character_ids = collect($character->character_id);
            
            
            Severity: Major
            Found in src/Http/Controllers/Character/IntelController.php - About 2 hrs to fix

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

                  public function ajax()
                  {
                      return datatables()
                          ->eloquent($this->applyScopes($this->query()))
                          ->editColumn('date', function ($row) {

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

                    if ($(this).attr('form') === undefined) {
                        currentForm = $(this).closest("form");
                    } else {
                        currentForm = $('#'.concat($(this).attr('form')))
                    }
                Severity: Major
                Found in src/resources/js/seat.js and 1 other location - About 2 hrs to fix
                src/resources/js/seat.js on lines 14..18

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

                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

                    if ($(this).attr('form') === undefined) {
                        currentForm = $(this).closest("form");
                    } else {
                        currentForm = $('#'.concat($(this).attr('form')))
                    }
                Severity: Major
                Found in src/resources/js/seat.js and 1 other location - About 2 hrs to fix
                src/resources/js/seat.js on lines 37..41

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

                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

                                $query->whereHas('type', function ($item) use ($keyword) {
                                    $item->whereRaw('typeName LIKE ?', ["%{$keyword}%"]);
                                })->orWhereHas('content.type', function ($content) use ($keyword) {
                                    $content->whereRaw('typeName LIKE ?', ["%{$keyword}%"]);
                                })->orWhereHas('content.content.type', function ($content) use ($keyword) {
                Severity: Major
                Found in src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php and 3 other locations - About 2 hrs to fix
                src/Http/DataTables/Character/Intel/Assets/Columns/Station.php on lines 111..117
                src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php on lines 93..99
                src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php on lines 103..109

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

                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

                        $query->orWhereHas('container.container', function ($container) use ($keyword) {
                            $container->whereRaw('name LIKE ?', ["%{$keyword}%"]);
                        })->orWhereHas('container.container.station', function ($station) use ($keyword) {
                            $station->whereRaw('name LIKE ?', ["%{$keyword}%"]);
                        })->orWhereHas('container.container.structure', function ($structure) use ($keyword) {
                src/Http/DataTables/Character/Intel/Assets/Columns/Station.php on lines 111..117
                src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php on lines 75..81
                src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php on lines 93..99

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

                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

                        $query->orWhereHas('container', function ($container) use ($keyword) {
                            $container->whereRaw('name LIKE ?', ["%{$keyword}%"]);
                        })->orWhereHas('container.station', function ($station) use ($keyword) {
                            $station->whereRaw('name LIKE ?', ["%{$keyword}%"]);
                        })->orWhereHas('container.structure', function ($structure) use ($keyword) {
                src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php on lines 75..81
                src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php on lines 93..99
                src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php on lines 103..109

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

                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

                        $query->orWhereHas('container', function ($container) use ($keyword) {
                            $container->whereRaw('name LIKE ?', ["%{$keyword}%"]);
                        })->orWhereHas('container.station', function ($station) use ($keyword) {
                            $station->whereRaw('name LIKE ?', ["%{$keyword}%"]);
                        })->orWhereHas('container.structure', function ($structure) use ($keyword) {
                src/Http/DataTables/Character/Intel/Assets/Columns/Station.php on lines 111..117
                src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php on lines 75..81
                src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php on lines 103..109

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

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

                    public function apply($query)
                    {
                        if ($this->requested_characters != null) {
                            $character_ids = collect($this->requested_characters)->filter(function ($item) {
                                return Gate::allows('character.intel', [$item]);
                Severity: Major
                Found in src/Http/DataTables/Scopes/CharacterNoteScope.php - About 2 hrs to fix

                  Method apply has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function apply($query)
                      {
                          if ($this->requested_characters != null) {
                              $character_ids = collect($this->requested_characters)->filter(function ($item) {
                                  return Gate::allows('character.killmail', [$item]);
                  Severity: Major
                  Found in src/Http/DataTables/Scopes/KillMailCharacterScope.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language