src/Http/Controllers/Support/SearchController.php

Summary

Maintainability
B
5 hrs
Test Coverage

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

        public function getSearchCharacterAssetsData(Request $request)
        {
            $scope = new CharacterScope('character.asset');
    
            $query = CharacterAsset::with('character', 'type', 'type.group', 'station', 'container', 'container.station',
    Severity: Minor
    Found in src/Http/Controllers/Support/SearchController.php - About 1 hr to fix

      Avoid too many return statements within this method.
      Open

                      return $query->whereRaw('character_assets.name LIKE ?', ["%$search%"]);
      Severity: Major
      Found in src/Http/Controllers/Support/SearchController.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return view('web::partials.type', [
                            'type_id' => $row->type->typeID,
                            'type_name' => $row->type->typeName,
                            'variation' => $row->type->group->categoryID == 9 ? 'bpc' : 'icon',
                        ]);
        Severity: Major
        Found in src/Http/Controllers/Support/SearchController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $table->make(true);
          Severity: Major
          Found in src/Http/Controllers/Support/SearchController.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return $row->station->name ?: ($row->structure->name ?: $row->container->name);
            Severity: Major
            Found in src/Http/Controllers/Support/SearchController.php - About 30 mins to fix

              The class SearchController has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
              Open

              class SearchController extends Controller
              {
                  /**
                   * @param  \Illuminate\Http\Request  $request
                   * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View

              CouplingBetweenObjects

              Since: 1.1.0

              A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

              Example

              class Foo {
                  /**
                   * @var \foo\bar\X
                   */
                  private $x = null;
              
                  /**
                   * @var \foo\bar\Y
                   */
                  private $y = null;
              
                  /**
                   * @var \foo\bar\Z
                   */
                  private $z = null;
              
                  public function setFoo(\Foo $foo) {}
                  public function setBar(\Bar $bar) {}
                  public function setBaz(\Baz $baz) {}
              
                  /**
                   * @return \SplObjectStorage
                   * @throws \OutOfRangeException
                   * @throws \InvalidArgumentException
                   * @throws \ErrorException
                   */
                  public function process(\Iterator $it) {}
              
                  // ...
              }

              Source https://phpmd.org/rules/design.html#couplingbetweenobjects

              Avoid unused parameters such as '$request'.
              Open

                  public function getSearchCharactersData(Request $request)

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused parameters such as '$request'.
              Open

                  public function getSearchCharacterSkillsData(Request $request)

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused parameters such as '$request'.
              Open

                  public function getSearchCorporationsData(Request $request)

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused parameters such as '$request'.
              Open

                  public function getSearchMailData(Request $request)

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              Avoid unused parameters such as '$request'.
              Open

                  public function getSearchCharacterAssetsData(Request $request)

              UnusedFormalParameter

              Since: 0.2

              Avoid passing parameters to methods or constructors and then not using those parameters.

              Example

              class Foo
              {
                  private function bar($howdy)
                  {
                      // $howdy is not used
                  }
              }

              Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

              There are no issues that match your filters.

              Category
              Status