Showing 23 of 279 total issues
File ReservationController.php
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Http\Controllers;
use App\Http\Interfaces\ManageTableInterface;
Method getFields
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFields()
{
return [
[
'id' => 'first_name',
ReservationController
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ReservationController extends Controller implements ManageTableInterface
{
protected $reservationTableService;
public function __construct(ReservationTableService $reservationTableService)
Method getFields
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFields()
{
return [
[
'id' => 'number',
Method getFields
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFields()
{
return [
[
'id' => 'name',
Method add
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function add($guestId, $roomId)
{
if (!$this->isReservationDataInSessionCorrect()) {
return $this->returnBack([
'message' => trans('general.session_error'),
Method postEdit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function postEdit(ReservationEditRequest $request, $objectId)
{
try {
$object = Reservation::with('room:id,capacity')
->findOrFail($objectId);
Method getFields
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFields($forAdd = false)
{
return [
[
'id' => 'date_start',
Method chooseFreeRoom
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function chooseFreeRoom(RoomTableService $roomTableService, $guestId)
{
if (!$this->isReservationDataInSessionCorrect()) {
return $this->returnBack([
'message' => trans('general.session_error'),
Method getColumns
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getColumns()
{
$dataset = [
[
'title' => trans('general.first_name'),
Method getColumns
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getColumns()
{
$dataset = [
[
'title' => trans('general.room'),
Method getColumns
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getColumns()
{
$dataset = [
[
'title' => trans('general.number'),
Method editChangeRoom
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function editChangeRoom($reservationId, $roomId)
{
try {
$reservation = Reservation::select('id', 'people', 'date_start', 'date_end')
->findOrFail($reservationId);
Method getActionButtons
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getActionButtons()
{
return [
'id' => 'action_buttons',
'type' => 'buttons',
Method editChooseRoom
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function editChooseRoom(RoomTableService $roomTableService, $reservationId)
{
try {
$reservation = Reservation::select('id', 'guest_id', 'date_start', 'date_end', 'people')
->findOrFail($reservationId);
Method getInitialStateFields
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getInitialStateFields()
{
return [
[
'id' => 'rooms',
Avoid too many return
statements within this method. Open
Open
return $dataset;
Avoid too many return
statements within this method. Open
Open
return $data->contact;
Avoid too many return
statements within this method. Open
Open
return $data->comment;
Avoid too many return
statements within this method. Open
Open
return $data->people;