Completed
Push — master ( 9697ab...60ecca )
by Mike
11:00 queued 04:55
created

CreateBooks   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Importance

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

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateBooks extends Migration
7
{
8
    public function up()
9
    {
10
        Schema::create('books', function (Blueprint $table) {
11
            $table->increments('id');
12
            $table->unsignedInteger('author_id');
13
            $table->timestamps();
14
15
            $table->text('description');
16
            $table->dateTime('published_at');
17
            $table->string('title');
18
        });
19
    }
20
21
    public function down()
22
    {
23
        //
24
    }
25
}
26