CreateBotsTables::up()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 57

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 57
rs 8.9381
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
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
8
class CreateBotsTables extends Migration
9
{
10
    /**
11
     * Run the migrations.
12
     *
13
     * @return void
14
     */
15
    public function up()
16
    {
17
        Schema::create(
18
            'bot_runners', function (Blueprint $table) {
19
                $table->increments('id');
20
                $table->string('action_code')->nullable();
21
                $table->string('target_id')->nullable();
22
                $table->string('progress')->nullable();
23
                $table->string('stage')->nullable();
24
                $table->timestamps();
25
            }
26
        );
27
        Schema::create(
28
            'bot_internet_urls', function (Blueprint $table) {
29
                $table->increments('id');
30
                $table->string('url')->nullable();
31
                $table->string('type')->nullable(); //get ou post 
32
                $table->string('response_format')->nullable(); //html ou json, ou xml 
33
                $table->string('title')->nullable();
34
                $table->string('crawled')->nullable();
35
                $table->string('crawl_tag')->nullable();
36
                $table->string('clicks')->nullable();
37
                $table->string('links')->nullable();
38
                $table->integer('infra_domain_id')->nullable();
39
                $table->integer('bot_internet_url_form_id')->nullable();
40
                $table->timestamps();
41
            }
42
        );
43
        Schema::create(
44
            'bot_internet_url_links', function (Blueprint $table) {
45
                $table->increments('id');
46
                $table->integer('from_bot_internet_url_id')->nullable();
47
                $table->integer('to_bot_internet_url_id')->nullable();
48
                $table->timestamps();
49
            }
50
        );
51
        Schema::create(
52
            'bot_internet_url_forms', function (Blueprint $table) {
53
                $table->increments('id');
54
                $table->string('identify')->nullable();
55
                $table->string('name')->nullable();
56
                $table->string('url')->nullable();
57
                $table->integer('from_bot_internet_url_id')->nullable(); // SIte aonde o formulario esta sendo preencido
58
                $table->integer('to_bot_internet_url_id')->nullable(); // Site para onde o formulario esta indo
59
                $table->timestamps();
60
            }
61
        );
62
        Schema::create(
63
            'bot_internet_url_form_fields', function (Blueprint $table) {
64
                $table->increments('id');
65
                $table->string('name')->nullable();
66
                $table->string('type')->nullable();
67
                $table->integer('bot_internet_url_form_id')->nullable();
68
                $table->timestamps();
69
            }
70
        );
71
    }
72
    /**
73
     * Reverse the migrations.
74
     *
75
     * @return void
76
     */
77
    public function down()
78
    {
79
        Schema::dropIfExists('bots');
80
    }
81
}
82