Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Branch master (114f68)
by Mark
09:17
created

CreatePluginsTable::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 71
Code Lines 59

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 59
nc 1
nop 0
dl 0
loc 71
rs 9.1369
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
use App\Model\Plugin;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class CreatePluginsTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14
    public function up()
15
    {
16
        \Schema::create('plugins', function (Blueprint $table) {
17
            $table->increments('id');
18
            $table->string('name');
19
            $table->string('version');
20
            $table->string('icon');
21
            $table->tinyInteger('enabled')->nullable();
22
            $table->tinyInteger('installed')->nullable();
23
            $table->tinyInteger('hidden')->nullable();
24
            $table->tinyInteger('required')->nullable();
25
            $table->tinyInteger('is_frontend')->nullable();
26
            $table->tinyInteger('is_backend')->nullable();
27
            $table->timestamps();
28
        });
29
30
        /*
31
         * DATA REQUIRED FOR APPLICATION CORE LOADING.
32
         */
33
        $plugin = new Plugin;
34
        $plugin->setName('products');
35
        $plugin->setVersion('1.0');
36
        $plugin->setIcon('fa-book');
37
        $plugin->setEnabled(true);
38
        $plugin->setRequired(true);
39
        $plugin->setFrontEnd(false);
40
        $plugin->setBackEnd(true);
41
        $plugin->save();
42
43
        $plugin = new Plugin;
44
        $plugin->setName('menus');
45
        $plugin->setVersion('1.0');
46
        $plugin->setIcon('fa-bars');
47
        $plugin->setEnabled(true);
48
        $plugin->setFrontEnd(false);
49
        $plugin->setBackEnd(true);
50
        $plugin->save();
51
52
        $plugin = new Plugin;
53
        $plugin->setName('pages');
54
        $plugin->setVersion('1.0');
55
        $plugin->setIcon('fa-paperclip');
56
        $plugin->setEnabled(true);
57
        $plugin->setFrontEnd(true);
58
        $plugin->setBackEnd(true);
59
        $plugin->save();
60
61
        $plugin = new Plugin;
62
        $plugin->setName('news');
63
        $plugin->setVersion('1.0');
64
        $plugin->setIcon('fa-newspaper-o');
65
        $plugin->setFrontEnd(true);
66
        $plugin->setBackEnd(true);
67
        $plugin->save();
68
69
        $plugin = new Plugin;
70
        $plugin->setName('redirects');
71
        $plugin->setVersion('1.0');
72
        $plugin->setIcon('fa-magic');
73
        $plugin->setFrontEnd(true);
74
        $plugin->setBackEnd(true);
75
        $plugin->save();
76
77
        $plugin = new Plugin;
78
        $plugin->setName('facebook');
79
        $plugin->setVersion('2.8');
80
        $plugin->setIcon('fa-facebook-official');
81
        $plugin->setHide(true);
82
        $plugin->setFrontEnd(true);
83
        $plugin->setBackEnd(true);
84
        $plugin->save();
85
    }
86
87
    /**
88
     * Reverse the migrations.
89
     *
90
     * @return void
91
     */
92
    public function down()
93
    {
94
        \Schema::dropIfExists('plugins');
95
    }
96
}
97