Completed
Push — master ( 272972...71d40e )
by Manel
03:05
created

SubmodulesTableSeeder::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 62
Code Lines 49

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 62
ccs 0
cts 57
cp 0
rs 9.4743
cc 1
eloc 49
nc 1
nop 0
crap 2

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Scool\EnrollmentMobile\Database\Seeds;
4
5
use Illuminate\Database\Seeder;
6
use Scool\EnrollmentMobile\Models\Submodule;
7
8
class SubmodulesTableSeeder extends Seeder
9
{
10
    /**
11
     * Run the database seeds.
12
     *
13
     * @return void
14
     */
15
    public function run()
16
    {
17
        factory(Submodule::class)->create([
18
            "name" => "UF1 - Instal·lació, configuració i explotació del sistema informàtic",
19
            "order" => 1,
20
            "type" => 1,
21
            "total_hours" => 1000,
22
            "week_hours" => 10,
23
            "start_date" => 12-31-2016,
24
            "end_date" => 01-03-2017
25
        ]);
26
        factory(Submodule::class)->create([
27
            "name" => "UF2 - Gestió de la informació i de recursos en una xarxa",
28
            "order" => 1,
29
            "type" => 1,
30
            "total_hours" => 1000,
31
            "week_hours" => 10,
32
            "start_date" => 12-31-2016,
33
            "end_date" => 01-03-2017
34
        ]);
35
36
        factory(Submodule::class)->create([
37
            "name" => "UF3 - Implantació de programari específic",
38
            "order" => 1,
39
            "type" => 1,
40
            "total_hours" => 1000,
41
            "week_hours" => 10,
42
            "start_date" => 12-31-2016,
43
            "end_date" => 01-03-2017
44
        ]);
45
46
        factory(Submodule::class)->create([
47
            "name" => "UF4 - Introducció a les bases de dades",
48
            "order" => 1,
49
            "type" => 1,
50
            "total_hours" => 1000,
51
            "week_hours" => 10,
52
            "start_date" => 12-31-2016,
53
            "end_date" => 01-03-2017
54
        ]);
55
56
        factory(Submodule::class)->create([
57
            "name" => "UF2 - Àmbits d'aplicació de l'àmbit XML",
58
            "order" => 1,
59
            "type" => 1,
60
            "total_hours" => 1000,
61
            "week_hours" => 10,
62
            "start_date" => 12-31-2016,
63
            "end_date" => 01-03-2017
64
        ]);
65
66
        factory(Submodule::class)->create([
67
            "name" => "UF2 - Àmbits d'aplicació de l'àmbit XML",
68
            "order" => 1,
69
            "type" => 1,
70
            "total_hours" => 1000,
71
            "week_hours" => 10,
72
            "start_date" => 12-31-2016,
73
            "end_date" => 01-03-2017
74
        ]);
75
76
    }
77
}
78