Completed
Pull Request — master (#24)
by
unknown
11:40 queued 10s
created

DropBotanTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 5 1
A down() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
use Illuminate\Database\Migrations\Migration;
6
use Illuminate\Database\Schema\Blueprint;
7
8
class DropBotanTable extends Migration
9
{
10
    public function up()
11
    {
12
        $tablePrefix = config('phptelegrambot.database.prefix', '');
0 ignored issues
show
Unused Code introduced by
$tablePrefix is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
13
        Schema::dropIfExists(config('phptelegrambot.database.prefix', '') . 'botan_shortener');
14
    }
15
16
    public function down()
17
    {
18
        /*
19
         * Not used
20
         */
21
    }
22
}
23