herpaderpaldent/seat-groups

View on GitHub
src/Http/Controllers/SeatGroupUserController.php

Summary

Maintainability
B
6 hrs
Test Coverage

Showing 6 of 6 total issues

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

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

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

        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

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

        return DataTables::of($seatgroup_members)
        ->addColumn('name', function ($row) {
        return view('seatgroups::partials.modal-partials.modal-name', compact('row'))->render();
        })
        ->addColumn('actions', function ($row) {
        Severity: Major
        Found in src/Http/Controllers/SeatGroupUserController.php and 1 other location - About 1 hr to fix
        src/Http/Controllers/Affiliation/SeatGroupAffiliationController.php on lines 23..31

        There are no issues that match your filters.

        Category
        Status