NukaCodeUserSeeder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 75 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 12
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 12 12 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\Seeder;
4
5
class NukaCodeUserSeeder extends Seeder
6
{
7
8 View Code Duplication
    public function run()
9
    {
10
        // Truncate the table each time.
11
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
12
        DB::table('users')->truncate();
13
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
14
15
        $users = config('users.users');
16
17
        // Add any data to the table.
18
        DB::table('users')->insert($users);
19
    }
20
}
21