CreateStripeAccountsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 34
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 15 15 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
2
3
use Illuminate\Database\Migrations\Migration;
4
use Illuminate\Database\Schema\Blueprint;
5
6
/**
7
 * Class CreateStripeAccountsTable
8
 *
9
 * @author  Mahmoud Zalt  <[email protected]>
10
 */
11 View Code Duplication
class CreateStripeAccountsTable extends Migration
0 ignored issues
show
Duplication introduced by Mahmoud Zalt
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
14
    /**
15
     * Run the migrations.
16
     *
17
     * @return void
18
     */
19
    public function up()
20
    {
21
        Schema::create('stripe_accounts', function (Blueprint $table) {
22
            $table->increments('id');
23
24
            $table->string('customer_id');
25
            $table->string('card_id')->nullable();
26
            $table->string('card_funding')->nullable();
27
            $table->string('card_last_digits')->nullable();
28
            $table->string('card_fingerprint')->nullable();
29
30
            $table->timestamps();
31
            $table->softDeletes();
32
        });
33
    }
34
35
    /**
36
     * Reverse the migrations.
37
     *
38
     * @return void
39
     */
40
    public function down()
41
    {
42
        Schema::drop('stripe_accounts');
43
    }
44
}
45