Saibamen/HotelManager

View on GitHub

Showing 23 of 279 total issues

File ReservationController.php has 525 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App\Http\Controllers;

use App\Http\Interfaces\ManageTableInterface;
Severity: Major
Found in app/Http/Controllers/ReservationController.php - About 1 day to fix

    Method getFields has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getFields()
        {
            return [
                [
                    'id'    => 'first_name',
    Severity: Major
    Found in app/Http/Controllers/GuestController.php - About 3 hrs to fix

      ReservationController has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class ReservationController extends Controller implements ManageTableInterface
      {
          protected $reservationTableService;
      
          public function __construct(ReservationTableService $reservationTableService)
      Severity: Minor
      Found in app/Http/Controllers/ReservationController.php - About 2 hrs to fix

        Method getFields has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getFields()
            {
                return [
                    [
                        'id'    => 'number',
        Severity: Major
        Found in app/Http/Controllers/RoomController.php - About 2 hrs to fix

          Method getFields has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getFields()
              {
                  return [
                      [
                          'id'    => 'name',
          Severity: Minor
          Found in app/Http/Controllers/UserController.php - About 1 hr to fix

            Method add has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function add($guestId, $roomId)
                {
                    if (!$this->isReservationDataInSessionCorrect()) {
                        return $this->returnBack([
                            'message'     => trans('general.session_error'),
            Severity: Minor
            Found in app/Http/Controllers/ReservationController.php - About 1 hr to fix

              Method postEdit has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function postEdit(ReservationEditRequest $request, $objectId)
                  {
                      try {
                          $object = Reservation::with('room:id,capacity')
                              ->findOrFail($objectId);
              Severity: Minor
              Found in app/Http/Controllers/ReservationController.php - About 1 hr to fix

                Method getFields has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getFields($forAdd = false)
                    {
                        return [
                            [
                                'id'    => 'date_start',
                Severity: Minor
                Found in app/Http/Controllers/ReservationController.php - About 1 hr to fix

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

                      public function chooseFreeRoom(RoomTableService $roomTableService, $guestId)
                      {
                          if (!$this->isReservationDataInSessionCorrect()) {
                              return $this->returnBack([
                                  'message'     => trans('general.session_error'),
                  Severity: Minor
                  Found in app/Http/Controllers/ReservationController.php - About 1 hr to fix

                    Method getColumns has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getColumns()
                        {
                            $dataset = [
                                [
                                    'title' => trans('general.first_name'),
                    Severity: Minor
                    Found in app/Services/GuestTableService.php - About 1 hr to fix

                      Method getColumns has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getColumns()
                          {
                              $dataset = [
                                  [
                                      'title' => trans('general.room'),
                      Severity: Minor
                      Found in app/Services/ReservationTableService.php - About 1 hr to fix

                        Method getColumns has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getColumns()
                            {
                                $dataset = [
                                    [
                                        'title' => trans('general.number'),
                        Severity: Minor
                        Found in app/Services/RoomTableService.php - About 1 hr to fix

                          Method editChangeRoom has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function editChangeRoom($reservationId, $roomId)
                              {
                                  try {
                                      $reservation = Reservation::select('id', 'people', 'date_start', 'date_end')
                                          ->findOrFail($reservationId);
                          Severity: Minor
                          Found in app/Http/Controllers/ReservationController.php - About 1 hr to fix

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

                                public function getActionButtons()
                                {
                                    return [
                                        'id'         => 'action_buttons',
                                        'type'       => 'buttons',
                            Severity: Minor
                            Found in app/Http/Controllers/ReservationController.php - About 1 hr to fix

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

                                  public function editChooseRoom(RoomTableService $roomTableService, $reservationId)
                                  {
                                      try {
                                          $reservation = Reservation::select('id', 'guest_id', 'date_start', 'date_end', 'people')
                                              ->findOrFail($reservationId);
                              Severity: Minor
                              Found in app/Http/Controllers/ReservationController.php - About 1 hr to fix

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

                                    public function getInitialStateFields()
                                    {
                                        return [
                                            [
                                                'id'    => 'rooms',
                                Severity: Minor
                                Found in app/Http/Controllers/AdminController.php - About 1 hr to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return $dataset;
                                  Severity: Major
                                  Found in app/Services/RoomTableService.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                        return $data->contact;
                                    Severity: Major
                                    Found in app/Services/GuestTableService.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                          return $data->comment;
                                      Severity: Major
                                      Found in app/Services/RoomTableService.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                            return $data->people;
                                        Severity: Major
                                        Found in app/Services/ReservationTableService.php - About 30 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language