GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 9dca68...baaa35 )
by Nikhil
10:35
created

CreateSalesTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 13 13 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\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6 View Code Duplication
class CreateSalesTable extends Migration
0 ignored issues
show
Duplication introduced by
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...
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...
7
{
8
    /**
9
     * Run the migrations.
10
     *
11
     * @return void
12
     */
13
    public function up()
14
    {
15
        Schema::create('sales', function (Blueprint $table) {
16
            $table->increments('id');
17
            $table->integer('guitar_id')->unsigned();
18
            $table->foreign('guitar_id')->references('id')->on('guitars')->onDelete('cascade');
19
            $table->string('name')->nullable();
20
            $table->string('address')->nullable();
21
            $table->integer('shop_id')->unsigned()->nullable();
22
            $table->foreign('shop_id')->references('id')->on('shops')->onDelete('cascade');
23
            $table->timestamps();
24
        });
25
    }
26
27
    /**
28
     * Reverse the migrations.
29
     *
30
     * @return void
31
     */
32
    public function down()
33
    {
34
        Schema::drop('sales');
35
    }
36
}
37