Completed
Push — master ( 8f332a...9f34da )
by Manel
04:20
created

SubmodulesTableSeeder::run()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 79
Code Lines 64

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 79
rs 8.8701
c 1
b 0
f 0
ccs 0
cts 73
cp 0
cc 1
eloc 64
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
            "module_id" => 1,
24
            "start_date" => 12-31-2016,
25
            "end_date" => 01-03-2017
26
        ]);
27
        factory(Submodule::class)->create([
28
            "name" => "UF2 - Gestió de la informació i de recursos en una xarxa",
29
            "order" => 1,
30
            "type" => 1,
31
            "total_hours" => 1000,
32
            "week_hours" => 10,
33
            "module_id" => 1,
34
            "start_date" => 12-31-2016,
35
            "end_date" => 01-03-2017
36
        ]);
37
38
        factory(Submodule::class)->create([
39
            "name" => "UF3 - Implantació de programari específic",
40
            "order" => 1,
41
            "type" => 2,
42
            "total_hours" => 1000,
43
            "week_hours" => 10,
44
            "module_id" => 1,
45
            "start_date" => 12-31-2016,
46
            "end_date" => 01-03-2017
47
        ]);
48
49
        factory(Submodule::class)->create([
50
            "name" => "UF4 - Introducció a les bases de dades",
51
            "order" => 1,
52
            "type" => 3,
53
            "total_hours" => 1000,
54
            "week_hours" => 10,
55
            "module_id" => 1,
56
            "start_date" => 12-31-2016,
57
            "end_date" => 01-03-2017
58
        ]);
59
60
        factory(Submodule::class)->create([
61
            "name" => "UF2 - Àmbits d'aplicació de l'àmbit XML",
62
            "order" => 1,
63
            "type" => 1,
64
            "total_hours" => 1000,
65
            "week_hours" => 10,
66
            "module_id" => 4,
67
            "start_date" => 12-31-2016,
68
            "end_date" => 01-03-2017
69
        ]);
70
71
        factory(Submodule::class)->create([
72
            "name" => "UF1 - Submodule 1",
73
            "order" => 1,
74
            "type" => 1,
75
            "total_hours" => 1000,
76
            "week_hours" => 10,
77
            "module_id" => 5,
78
            "start_date" => 12-31-2016,
79
            "end_date" => 01-03-2017
80
        ]);
81
82
        factory(Submodule::class)->create([
83
            "name" => "UF2 - Submodule 2",
84
            "order" => 1,
85
            "type" => 1,
86
            "total_hours" => 1000,
87
            "week_hours" => 10,
88
            "module_id" => 6,
89
            "start_date" => 12-31-2016,
90
            "end_date" => 01-03-2017
91
        ]);
92
93
    }
94
}
95