herpaderpaldent/seat-groups

View on GitHub

Showing 20 of 30 total issues

Function isQualified has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function isQualified(Group $group)
    {

        $action = new GetCurrentAffiliationAction;

Severity: Minor
Found in src/Models/SeatGroup.php - About 3 hrs 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 update has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function update(Request $request, $id)
    {

        $seatgroup = SeatGroup::find($id);

Severity: Minor
Found in src/Http/Controllers/SeatGroupUserController.php - About 1 hr 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

Method update has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function update(Request $request, $id)
    {

        $seatgroup = SeatGroup::find($id);

Severity: Minor
Found in src/Http/Controllers/SeatGroupUserController.php - About 1 hr to fix

    Method execute has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function execute(array $data)
        {
            $seatgroup = SeatGroup::find($data['seatgroup_id']);
    
            $affiliations = collect();
    Severity: Minor
    Found in src/Actions/SeatGroups/GetCurrentAffiliationAction.php - About 1 hr to fix

      Method handle has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function handle(GroupApplication $event)
          {
              $should_send = false;
      
              if (class_exists(SeatNotificationsServiceProvider::class))
      Severity: Minor
      Found in src/Listeners/GroupApplicationNotification.php - About 1 hr to fix

        Method up has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function up()
            {
                Schema::create('seatgroups', function ($table) {
                   $table->increments('id')->index();
                   $table->string('name');
        Severity: Minor
        Found in src/database/migrations/2018_02_11_144653_initial_deployment.php - About 1 hr to fix

          Method execute has 28 lines of code (exceeds 25 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 1 hr to fix

            Function mergeConfigs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function mergeConfigs(array $original, array $merging)
                {
                    $array = array_merge($original, $merging);
            
                    foreach ($original as $key => $value) {
            Severity: Minor
            Found in src/GroupsServiceProvider.php - About 1 hr 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

            Method execute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function execute(Group $group) : Collection
                {
            
                    $this->group = $group;
            
            
            Severity: Minor
            Found in src/Actions/Sync/GetRolesToSyncAction.php - About 1 hr to fix

              Method handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function handle(GroupSynced $event)
                  {
                      if (empty($event->sync['attached']) && empty($event->sync['detached']))
                          $this->delete();
              
              
              Severity: Minor
              Found in src/Listeners/CreateSyncedSeatLogsEntry.php - About 1 hr to fix

                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