EscolaLMS/Consultations

View on GitHub
database/migrations/2022_02_18_110049_create_consultation_proposed_terms_tale.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'up'.
Open

        Schema::create('consultation_proposed_terms', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('consultation_id')->unsigned();
            $table->dateTime('proposed_at');
            $table->timestamps();

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\Schema' in method 'down'.
Open

        Schema::dropIfExists('consultation_proposed_terms');

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Call to method id from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->id();

Call to method bigInteger from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->bigInteger('consultation_id')->unsigned();

Class extends undeclared class \Illuminate\Database\Migrations\Migration
Open

class CreateConsultationProposedTermsTale extends Migration

Call to method create from undeclared class \Illuminate\Support\Facades\Schema
Open

        Schema::create('consultation_proposed_terms', function (Blueprint $table) {

Call to method dropIfExists from undeclared class \Illuminate\Support\Facades\Schema
Open

        Schema::dropIfExists('consultation_proposed_terms');

Call to method dateTime from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->dateTime('proposed_at');

Call to method foreign from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->foreign('consultation_id')->on('consultations')->references('id')->cascadeOnDelete();

Call to method timestamps from undeclared class \Illuminate\Database\Schema\Blueprint
Open

            $table->timestamps();

Parameter $table has undeclared type \Illuminate\Database\Schema\Blueprint
Open

        Schema::create('consultation_proposed_terms', function (Blueprint $table) {

Avoid using short method names like CreateConsultationProposedTermsTale::up(). The configured minimum method name length is 3.
Open

    public function up()
    {
        Schema::create('consultation_proposed_terms', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('consultation_id')->unsigned();

ShortMethodName

Since: 0.2

Detects when very short method names are used.

Example

class ShortMethod {
    public function a( $index ) { // Violation
    }
}

Source https://phpmd.org/rules/naming.html#shortmethodname

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class CreateConsultationProposedTermsTale extends Migration

There are no issues that match your filters.

Category
Status