CreateNotificationsTable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 37.93 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 11
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 11 11 1
A down() 0 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
use Illuminate\Support\Facades\Schema;
6
7
class CreateNotificationsTable extends Migration
8
{
9
    /**
10
     * Run the migrations.
11
     *
12
     * @return void
13
     */
14 View Code Duplication
    public function up()
0 ignored issues
show
Duplication introduced by Mahmoud Zalt
This method 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...
15
    {
16
        Schema::create('notifications', function (Blueprint $table) {
17
            $table->uuid('id')->primary();
18
            $table->string('type');
19
            $table->morphs('notifiable');
20
            $table->text('data');
21
            $table->timestamp('read_at')->nullable();
22
            $table->timestamps();
23
        });
24
    }
25
26
    /**
27
     * Reverse the migrations.
28
     *
29
     * @return void
30
     */
31
    public function down()
32
    {
33
        Schema::dropIfExists('notifications');
34
    }
35
}
36