EscolaLMS/Consultations

View on GitHub

Showing 1,241 of 1,241 total issues

Parameter $query has undeclared type \Illuminate\Database\Eloquent\Builder
Open

    public function apply(Builder $query): Builder

Return type of apply() is undeclared type \Illuminate\Database\Eloquent\Builder
Open

    public function apply(Builder $query): Builder

Return type of getConsultationsList() is undeclared type \Illuminate\Database\Eloquent\Builder
Open

    public function getConsultationsList(array $search = [], bool $onlyActive = false, OrderDto $orderDto = null): Builder;

syntax error, unexpected 'Consultation' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    private Consultation $consultation;

Reference to constant class from undeclared class \EscolaLms\Consultations\Http\Controllers\ConsultationController
Open

    Route::post('consultations/{id}', [ConsultationController::class, 'update']);
Severity: Critical
Found in src/routes.php by phan

Call to method get from undeclared class \Illuminate\Support\Facades\Route
Open

    Route::get('/my-schedule', [ConsultationAPIController::class, 'schedule']);
Severity: Critical
Found in src/routes.php by phan

syntax error, unexpected ')'
Open

            )

Class extends undeclared class \EscolaLms\Core\Repositories\Criteria\Criterion
Open

class OrderCriterion extends Criterion

Call to method whereHas from undeclared class \Illuminate\Database\Eloquent\Builder
Open

        return $query->whereHas('user');

Reference to constant class from undeclared class \EscolaLms\Consultations\Http\Controllers\ConsultationController
Open

    Route::post('consultations/change-term/{consultationTermId}', [ConsultationController::class, 'changeTerm']);
Severity: Critical
Found in src/routes.php by phan

Reference to constant class from undeclared class \EscolaLms\Consultations\Http\Controllers\ConsultationAPIController
Open

    Route::get('/me', [ConsultationAPIController::class, 'forCurrentUser']);
Severity: Critical
Found in src/routes.php by phan

Call to method post from undeclared class \Illuminate\Support\Facades\Route
Open

    Route::post('/change-term/{consultationTermId}', [ConsultationController::class, 'changeTerm']);
Severity: Critical
Found in src/routes.php by phan

Reference to constant class from undeclared class \EscolaLms\Consultations\Http\Controllers\ConsultationAPIController
Open

    Route::post('/finish-term/{consultationTermId}', [ConsultationAPIController::class, 'finishTerm']);
Severity: Critical
Found in src/routes.php by phan

Reference to constant class from undeclared class \EscolaLms\Consultations\Http\Controllers\ConsultationAPIController
Open

Route::post('api/consultations/save-screen', [ConsultationAPIController::class, 'screenSave']);
Severity: Critical
Found in src/routes.php by phan

Define a constant instead of duplicating this literal "required" 6 times.
Open

            'consultation_id' => ['required', 'exists:consultations,id'],

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 "orders" 7 times.
Open

            Schema::hasTable('orders') &&

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 "image_path" 3 times.
Open

        'image_path',
Severity: Critical
Found in src/Models/Consultation.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 "executed_status" 3 times.
Open

            $table->string('executed_status')->nullable();

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 "orders" 6 times.
Open

            Schema::hasTable('orders') &&

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 "executed_at" 5 times.
Open

            Schema::hasColumns('orders', ['executed_at', 'executed_status'])

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.

Severity
Category
Status
Source
Language