Showing 479 of 479 total issues

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

                switch ($row->sender->category) {
                    case 'alliance':
                        return view('web::partials.alliance', ['alliance' => $row->sender])->render();
                    case 'corporation':
                        return view('web::partials.corporation', ['corporation' => $row->sender])->render();
Severity: Minor
Found in src/Http/DataTables/Character/Intel/NotificationDataTable.php and 1 other location - About 35 mins to fix
src/Http/DataTables/Character/Intel/MailDataTable.php on lines 51..58

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

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

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

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

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

Refactorings

Further Reading

Function getStandingsAjaxElementName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStandingsAjaxElementName(Request $request)
    {

        $response = [
            'results' => [],
Severity: Minor
Found in src/Http/Controllers/Tools/StandingsController.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function store has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function store(ProbeReport $request)
    {
        $report = $request->input('moon-report');

        // enforce tabulation spacer
Severity: Minor
Found in src/Http/Controllers/Tools/MoonsController.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

<?php

/*
 * This file is part of SeAT
 *
Severity: Minor
Found in src/Http/Composers/CorporationLayout.php and 1 other location - About 30 mins to fix
src/Http/Composers/AllianceLayout.php on lines 1..56

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

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: Minor
Found in src/Http/Composers/AllianceLayout.php and 1 other location - About 30 mins to fix
src/Http/Composers/CorporationLayout.php on lines 1..56

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

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

        if ($request->query('_type', 'query') == 'find') {
            $constellation = Constellation::find($request->query('q', 0));

            if (is_null($constellation)) {
                return response()->json();
Severity: Minor
Found in src/Http/Controllers/Support/FastLookupController.php and 2 other locations - About 30 mins to fix
src/Http/Controllers/Support/FastLookupController.php on lines 386..397
src/Http/Controllers/Support/FastLookupController.php on lines 495..506

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

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

        if ($request->query('_type', 'query') == 'find') {
            $region = Region::find($request->query('q', 0));

            if (is_null($region)) {
                return response()->json();
Severity: Minor
Found in src/Http/Controllers/Support/FastLookupController.php and 2 other locations - About 30 mins to fix
src/Http/Controllers/Support/FastLookupController.php on lines 421..432
src/Http/Controllers/Support/FastLookupController.php on lines 495..506

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

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

        if ($request->query('_type', 'query') == 'find') {
            $system = SolarSystem::find($request->query('q', 0));

            if (is_null($system)) {
                return response()->json();
Severity: Minor
Found in src/Http/Controllers/Support/FastLookupController.php and 2 other locations - About 30 mins to fix
src/Http/Controllers/Support/FastLookupController.php on lines 386..397
src/Http/Controllers/Support/FastLookupController.php on lines 421..432

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

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

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

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

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

Refactorings

Further Reading

Avoid too many return statements within this method.
Open

            return $item->container->station->name;
Severity: Major
Found in src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return '';
    Severity: Major
    Found in src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $query->whereIntegerInRaw('object_id', $character_ids);
      Severity: Major
      Found in src/Http/DataTables/Scopes/CharacterNoteScope.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return 'table-danger';
        Severity: Major
        Found in src/Http/DataTables/Common/Intel/AbstractAssetDataTable.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              return $row->container->station->name;
          Severity: Major
          Found in src/Http/DataTables/Character/Intel/Assets/Columns/Station.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return [
                            'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                            'corporations' => collect($filters->corporation ?? [])->pluck('id')->toArray(),
                            'alliances'    => collect($filters->alliance ?? [])->pluck('id')->toArray(),
                        ];
            Severity: Major
            Found in src/Http/DataTables/Scopes/CharacterNoteScope.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $this->divisions->where('division', 5)->first()->name;

                Avoid too many return statements within this method.
                Open

                        return sprintf('%d (%d)', $row->item_id, $row->location_id);
                Severity: Major
                Found in src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          if ($permissions->filter(function ($permission) { return ! $permission->hasFilters(); })->isNotEmpty())
                  Severity: Major
                  Found in src/Http/DataTables/Scopes/AllianceScope.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $row->container->name ?: trans('web::seat.unknown');
                    Severity: Major
                    Found in src/Http/DataTables/Character/Intel/Assets/Columns/Station.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return [
                                      'characters'   => collect($filters->character ?? [])->pluck('id')->toArray(),
                                      'corporations' => collect($filters->corporation ?? [])->pluck('id')->toArray(),
                                      'alliances'    => collect($filters->alliance ?? [])->pluck('id')->toArray(),
                                  ];
                      Severity: Major
                      Found in src/Http/DataTables/Scopes/CharacterScope.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return $rules;
                        Severity: Major
                        Found in src/Http/Validation/RolePermission.php - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language