timegridio/timegrid

View on GitHub

Showing 28 of 390 total issues

File manager.php has 383 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return  [
  //============================== New strings to translate ==============================//
  'agenda' => [
Severity: Minor
Found in resources/lang/it_IT/manager.php - About 5 hrs to fix

File manager.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return  [
  //==================================== Translations ====================================//
  'agenda' => [
Severity: Minor
Found in resources/lang/hy_AM/manager.php - About 4 hrs to fix

File manager.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return  [
  //==================================== Translations ====================================//
  'agenda' => [
Severity: Minor
Found in resources/lang/en_US/manager.php - About 4 hrs to fix

File manager.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return  [
  //==================================== Translations ====================================//
  'agenda' => [
Severity: Minor
Found in resources/lang/fr_FR/manager.php - About 4 hrs to fix

File manager.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return  [
  //==================================== Translations ====================================//
  'agenda' => [
Severity: Minor
Found in resources/lang/es_ES/manager.php - About 4 hrs to fix

File manager.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return  [
  //==================================== Translations ====================================//
  'agenda' => [
Severity: Minor
Found in resources/lang/es_AR/manager.php - About 4 hrs to fix

File manager.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return  [
  //==================================== Translations ====================================//
  'agenda' => [
Severity: Minor
Found in resources/lang/ru_RU/manager.php - About 4 hrs to fix

File web.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
Severity: Minor
Found in routes/web.php - About 3 hrs to fix

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

    public function postStore(Request $request)
    {
        logger()->info(__METHOD__);

        //////////////////
Severity: Major
Found in app/Http/Controllers/User/AgendaController.php - About 2 hrs to fix

Method getAvailability has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getAvailability(Business $business, Request $request)
    {
        logger()->info(__METHOD__);

        if (auth()->user()) {
Severity: Minor
Found in app/Http/Controllers/User/AgendaController.php - About 1 hr to fix

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

    public function postAction(AlterAppointmentRequest $request)
    {
        logger()->info(__METHOD__);

        //////////////////
Severity: Minor
Found in app/Http/Controllers/API/BookingController.php - About 1 hr to fix

Method create has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create(Business $business)
    {
        logger()->info(__METHOD__);
        logger()->info(sprintf('businessId:%s', $business->id));

Severity: Minor
Found in app/Http/Controllers/Manager/BusinessVacancyController.php - About 1 hr to fix

Method init has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function init()
    {
        $this->boxes = [
            'appointments_active_today' => [
                'icon'  => 'check',
Severity: Minor
Found in app/TG/Business/Dashboard.php - About 1 hr to fix

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

    public function handle(AppointmentWasCanceled $event)
    {
        logger()->info(__METHOD__);

        $code = $event->appointment->code;
Severity: Minor
Found in app/Listeners/SendAppointmentCancellationNotification.php - About 1 hr to fix

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

    public function handle(AppointmentWasConfirmed $event)
    {
        logger()->info(__METHOD__);

        $code = $event->appointment->code;
Severity: Minor
Found in app/Listeners/SendAppointmentConfirmationNotification.php - About 1 hr to fix

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

    public function getAvailability(Business $business, Request $request)
    {
        logger()->info(__METHOD__);

        if (auth()->user()) {
Severity: Minor
Found in app/Http/Controllers/User/AgendaController.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

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

    public function postStore(Request $request)
    {
        logger()->info(__METHOD__);

        //////////////////
Severity: Minor
Found in app/Http/Controllers/User/AgendaController.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 store has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function store(Business $business, Request $request)
    {
        logger()->info(__METHOD__);
        logger()->info(sprintf('businessId:%s', $business->id));

Severity: Minor
Found in app/Http/Controllers/Manager/BusinessVacancyController.php - About 1 hr to fix

Function render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function render($request, Exception $exception)
    {
        if (app()->environment('production') || app()->environment('demo')) {
            // Catch TokenMismatchException to show a friendly error message
            if ($exception instanceof \Illuminate\Session\TokenMismatchException) {
Severity: Minor
Found in app/Exceptions/Handler.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

Method addSlots has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function addSlots(array &$times, Vacancy $vacancy, Carbon $beginTime, $duration, $step, $maxNumberOfSlots)
Severity: Minor
Found in app/TG/Availability/AvailabilityService.php - About 45 mins to fix
Severity
Category
Status
Source
Language