Completed
Push — master ( 5d8ba8...93e296 )
by Scott
02:28
created

CreateDriverConfigsTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 10 10 1
A down() 4 4 1

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 namespace Bedard\Shop\Updates;
2
3
use Schema;
4
use October\Rain\Database\Schema\Blueprint;
5
use October\Rain\Database\Updates\Migration;
6
7 View Code Duplication
class CreateDriverConfigsTable extends Migration
8
{
9
    public function up()
10
    {
11
        Schema::create('bedard_shop_driver_configs', function(Blueprint $table) {
12
            $table->engine = 'InnoDB';
13
            $table->increments('id');
14
            $table->string('driver')->default('');
15
            $table->json('config');
16
            $table->timestamps();
17
        });
18
    }
19
20
    public function down()
21
    {
22
        Schema::dropIfExists('bedard_shop_driver_configs');
23
    }
24
}
25