Passed
Push — master ( fde606...0af3c0 )
by Armando
08:21
created

CreateRequestLimiterTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 3 1
A up() 0 8 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
declare(strict_types=1);
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
use Illuminate\Support\Facades\Schema;
8
9
class CreateRequestLimiterTable extends Migration
10
{
11
    public function up(): void
12
    {
13
        Schema::create('request_limiter', static function (Blueprint $table) {
14
            $table->bigInteger('id', true)->unsigned()->comment('Unique identifier for this entry');
15
            $table->char('chat_id')->nullable()->comment('Unique chat identifier');
16
            $table->char('inline_message_id')->nullable()->comment('Identifier of the sent inline message');
17
            $table->char('method')->nullable()->comment('Request method');
18
            $table->dateTime('created_at')->nullable()->comment('Entry date creation');
19
        });
20
    }
21
22
    public function down(): void
23
    {
24
        Schema::dropIfExists('request_limiter');
25
    }
26
}
27