herpaderpaldent/seat-groups

View on GitHub

Showing 30 of 30 total issues

Function execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(array $data)
    {
        $seatgroup = SeatGroup::find($data['seatgroup_id']);

        if(isset($data['groups'])){
Severity: Minor
Found in src/Actions/Managers/AddManagerAction.php - About 55 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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute(Group $group)
    {
        $this->group = $group;
        $main_character = $this->get_main_character_action->execute($this->group);
        $this->has_missing_refresh_token = false;
Severity: Minor
Found in src/Actions/Sync/CatchMissingRefreshTokenAction.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 isManager has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function isManager(Group $group)
    {

        if (in_array($group->id, $this->manager->pluck('id')->toArray()))
            return true;
Severity: Minor
Found in src/Models/SeatGroup.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

Avoid too many return statements within this method.
Open

        return redirect()->back()->with('warning', 'ups something went wrong');
Severity: Major
Found in src/Http/Controllers/SeatGroupUserController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return false;
    Severity: Major
    Found in src/Models/SeatGroup.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return redirect()->back()->with('success', 'Updated');
      Severity: Major
      Found in src/Http/Controllers/SeatGroupUserController.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return false;
        Severity: Major
        Found in src/Listeners/GroupApplicationNotification.php - About 30 mins to fix

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

              public function execute(Group $group)
              {
                  $this->group = $group;
          
                  //Catch superuser permissions
          Severity: Minor
          Found in src/Actions/Sync/CatchSuperuserAction.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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function handle(GroupSynced $event)
              {
                  $should_send = false;
          
                  if (! empty($event->sync['attached']))
          Severity: Minor
          Found in src/Listeners/GroupSyncedNotification.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 destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function destroy($id)
              {
                  $seatgroup = SeatGroup::find($id);
          
                  if ($seatgroup->type == 'open') {
          Severity: Minor
          Found in src/Http/Controllers/SeatGroupUserController.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

          Severity
          Category
          Status
          Source
          Language