EscolaLMS/Webinar

View on GitHub
database/migrations/2022_03_31_072718_add_sender_status_in_webinar.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        Schema::table('webinars', function (Blueprint $table) {
            $table->dropColumn('reminder_status');
        });

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 'up'.
Open

        Schema::table('webinars', function (Blueprint $table) {
            $table->string('reminder_status', 30)->nullable();
        });

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

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

        Schema::table('webinars', function (Blueprint $table) {

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

            $table->string('reminder_status', 30)->nullable();

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

        Schema::table('webinars', function (Blueprint $table) {

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

        Schema::table('webinars', function (Blueprint $table) {

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

class AddSenderStatusInWebinar extends Migration

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

        Schema::table('webinars', function (Blueprint $table) {

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

            $table->dropColumn('reminder_status');

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

    public function up()
    {
        Schema::table('webinars', function (Blueprint $table) {
            $table->string('reminder_status', 30)->nullable();
        });

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 AddSenderStatusInWebinar extends Migration

There are no issues that match your filters.

Category
Status