These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | use Illuminate\Support\Facades\Schema; |
||
4 | use Illuminate\Database\Schema\Blueprint; |
||
5 | use Illuminate\Database\Migrations\Migration; |
||
6 | |||
7 | View Code Duplication | class CreateGoalsTable extends Migration |
|
0 ignored issues
–
show
|
|||
8 | { |
||
9 | /** |
||
10 | * Run the migrations. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('ab_goals', function (Blueprint $table) { |
||
17 | $table->increments('id'); |
||
18 | $table->string('name'); |
||
19 | $table->integer('hit'); |
||
20 | $table->integer('experiment_id'); |
||
21 | $table->timestamps(); |
||
22 | }); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Reverse the migrations. |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | public function down() |
||
31 | { |
||
32 | Schema::dropIfExists('ab_goals'); |
||
33 | } |
||
34 | } |
||
35 |
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.