Showing 479 of 479 total issues

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

    Avoid too many return statements within this method.
    Open

                        return $type->marketGroupID == Moon::EXCEPTIONAL;
    Severity: Major
    Found in src/Models/UniverseMoonReport.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                          return;
      Severity: Major
      Found in src/Http/Controllers/Support/ResolveController.php - About 30 mins 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 $collection->when($collection->isNotEmpty(), function ($ids) {
                              return $this->resolveInternalAllianceIDs($ids);
                          });
          Severity: Major
          Found in src/Http/Controllers/Support/ResolveController.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 $this->moon_indicators ?: (object) [
                          'ubiquitous' => 0,
                          'common' => 0,
                          'uncommon' => 0,
                          'rare' => 0,
              Severity: Major
              Found in src/Models/UniverseMoonReport.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                    return ! in_array($type->marketGroupID, [Moon::UBIQUITOUS, Moon::COMMON, Moon::UNCOMMON, Moon::RARE, Moon::EXCEPTIONAL]);
                Severity: Major
                Found in src/Models/UniverseMoonReport.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $collection->when($collection->isNotEmpty(), function ($ids) {
                                      return $this->resolveInternalCorporationIDs($ids);
                                  });
                  Severity: Major
                  Found in src/Http/Controllers/Support/ResolveController.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return response()->json($this->response);
                    Severity: Major
                    Found in src/Http/Controllers/Support/ResolveController.php - About 30 mins to fix

                      The method load_plugin_menu has a boolean flag argument $require_affiliation, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function load_plugin_menu(string $package_name, array $menu_data, bool $require_affiliation = false): ?array
                      Severity: Minor
                      Found in src/Http/Composers/AbstractMenu.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                      Function compose has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function compose(View $view)
                          {
                      
                              // This menu item declares the menu and
                              // sets it as an array of arrays.
                      Severity: Minor
                      Found in src/Http/Composers/AllianceMenu.php - About 25 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 compose has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function compose(View $view)
                          {
                      
                              // This menu item declares the menu and
                              // sets it as an array of arrays.
                      Severity: Minor
                      Found in src/Http/Composers/CharacterMenu.php - About 25 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 redirectToProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function redirectToProvider($profile = null, Socialite $social)
                          {
                      
                              $scopes_setting = collect(setting('sso_scopes', true));
                      
                      
                      Severity: Minor
                      Found in src/Http/Controllers/Auth/SsoController.php - About 25 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 compose has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function compose(View $view)
                          {
                      
                              // This menu item declares the menu and
                              // sets it as an array of arrays.
                      Severity: Minor
                      Found in src/Http/Composers/CorporationMenu.php - About 25 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

                      The method checkLoginToken uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  session()->push('user_sharing', $token->character_id);
                              }

                      ElseExpression

                      Since: 1.4.0

                      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($flag) {
                                  // one branch
                              } else {
                                  // another branch
                              }
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#elseexpression

                      Avoid unused private methods such as 'getEveSkillsGroups'.
                      Open

                          private function getEveSkillsGroups()
                          {
                      
                              $groups = InvGroup::where('categoryID', 16)
                                  ->where('groupID', '<>', 505)

                      UnusedPrivateMethod

                      Since: 0.2

                      Unused Private Method detects when a private method is declared but is unused.

                      Example

                      class Something
                      {
                          private function foo() {} // unused
                      }

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

                      Avoid unused parameters such as '$squad'.
                      Open

                          public function manage_roles(User $user, Squad $squad)
                      Severity: Minor
                      Found in src/Acl/Policies/SquadPolicy.php by phpmd

                      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 '$key'.
                      Open

                                  ->map(function ($alliance, $key) {

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language