Saibamen/HotelManager

View on GitHub
routes/web.php

Summary

Maintainability
A
0 mins
Test Coverage

Define a constant instead of duplicating this literal "reservationId" 4 times.
Open

    Route::get('reservation/edit_choose_guest/{reservationId}', 'ReservationController@editChooseGuest')->name('reservation.edit_choose_guest')->where(['reservationId' => '[0-9]+']);
Severity: Critical
Found in routes/web.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "login" 3 times.
Open

Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Severity: Critical
Found in routes/web.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "[0-9]+" 21 times.
Open

        Route::delete('user/delete/{id}', 'UserController@delete')->name('user.delete')->where(['id' => '[0-9]+']);
Severity: Critical
Found in routes/web.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Define a constant instead of duplicating this literal "guestId" 5 times.
Open

    Route::get('reservation/search_free_rooms/{guestId}', 'ReservationController@searchFreeRooms')->name('reservation.search_free_rooms')->where(['guestId' => '[0-9]+']);
Severity: Critical
Found in routes/web.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Line exceeds 120 characters; contains 170 characters
Open

    Route::get('reservation/search_free_rooms/{guestId}', 'ReservationController@searchFreeRooms')->name('reservation.search_free_rooms')->where(['guestId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 132 characters
Open

    Route::delete('reservation/delete/{id}', 'ReservationController@delete')->name('reservation.delete')->where(['id' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 135 characters
Open

    Route::get('reservation/edit/{id}', 'ReservationController@showEditForm')->name('reservation.editform')->where(['id' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 127 characters
Open

        Route::delete('admin/delete_reservations', 'AdminController@deleteAllReservations')->name('admin.delete_reservations');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 179 characters
Open

    Route::get('reservation/edit_choose_room/{reservationId}', 'ReservationController@editChooseRoom')->name('reservation.edit_choose_room')->where(['reservationId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 182 characters
Open

    Route::get('reservation/edit_choose_guest/{reservationId}', 'ReservationController@editChooseGuest')->name('reservation.edit_choose_guest')->where(['reservationId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 132 characters
Open

    Route::post('reservation/edit/{id}', 'ReservationController@postEdit')->name('reservation.postedit')->where(['id' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 180 characters
Open

    Route::post('reservation/search_free_rooms/{guestId}', 'ReservationController@postSearchFreeRooms')->name('reservation.post_search_free_rooms')->where(['guestId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 162 characters
Open

    Route::get('reservation/choose_room/{guestId}', 'ReservationController@chooseFreeRoom')->name('reservation.choose_free_room')->where(['guestId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 161 characters
Open

    Route::get('reservation/add/{guestId}/{roomId}', 'ReservationController@add')->name('reservation.add')->where(['guestId' => '[0-9]+', 'roomId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 215 characters
Open

    Route::get('reservation/edit_change_guest/{reservationId}/{guestId}', 'ReservationController@editChangeGuest')->name('reservation.edit_change_guest')->where(['reservationId' => '[0-9]+', 'guestId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 210 characters
Open

    Route::get('reservation/edit_change_room/{reservationId}/{roomId}', 'ReservationController@editChangeRoom')->name('reservation.edit_change_room')->where(['reservationId' => '[0-9]+', 'roomId' => '[0-9]+']);
Severity: Minor
Found in routes/web.php by phpcodesniffer

There are no issues that match your filters.

Category
Status