CreateH5pContentsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 18
dl 0
loc 36
c 1
b 1
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 18 1
A down() 0 3 1
1
<?php
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Support\Facades\Schema;
6
7
class CreateH5pContentsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        Schema::create('h5p_contents', function (Blueprint $table) {
17
            $table->bigIncrements('id');
18
            $table->timestamps();
19
            $table->bigInteger('user_id')->unsigned();
20
            $table->string('title');
21
            $table->bigInteger('library_id')->unsigned();
22
            $table->text('parameters');
23
            $table->text('filtered');
24
            $table->string('slug', 127);
25
            $table->string('embed_type', 127);
26
            $table->bigInteger('disable')->unsigned()->default(0);
27
            $table->string('content_type', 127)->nullable();
28
            $table->string('author', 127)->nullable();
29
            $table->string('license', 7)->nullable();
30
            $table->text('keywords', 65535)->nullable();
0 ignored issues
show
Unused Code introduced by
The call to Illuminate\Database\Schema\Blueprint::text() has too many arguments starting with 65535. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
            $table->/** @scrutinizer ignore-call */ 
31
                    text('keywords', 65535)->nullable();

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
31
            $table->text('description', 65535)->nullable();
32
        });
33
    }
34
35
    /**
36
     * Reverse the migrations.
37
     *
38
     * @return void
39
     */
40
    public function down()
41
    {
42
        Schema::drop('h5p_contents');
43
    }
44
}
45