Completed
Push — feature/user_input_newlines ( 7c3825...9ce77c )
by Tristan
15:58 queued 09:53
created

PopulateSkills::down()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 78
Code Lines 75

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 75
c 1
b 0
f 0
dl 0
loc 78
rs 8.5454
cc 1
nc 1
nop 0

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
use Illuminate\Support\Facades\Schema;
4
use Illuminate\Database\Schema\Blueprint;
5
use Illuminate\Database\Migrations\Migration;
6
7
class PopulateSkills extends Migration
8
{
9
    /**
10
    * Run the migrations.
11
    *
12
    * @return void
13
    */
14
    public function up()
15
    {
16
        DB::table('skills')->insert([
17
            ['skill_type_id' => 2, 'name' => 'front_end_dev'],
18
            ['skill_type_id' => 2, 'name' => 'web_programming'],
19
            ['skill_type_id' => 2, 'name' => 'server_admin'],
20
            ['skill_type_id' => 2, 'name' => 'linux'],
21
            ['skill_type_id' => 2, 'name' => 'css'],
22
            ['skill_type_id' => 2, 'name' => 'javascript'],
23
            ['skill_type_id' => 2, 'name' => 'c_plus_plus'],
24
            ['skill_type_id' => 2, 'name' => 'sass'],
25
            ['skill_type_id' => 2, 'name' => 'python'],
26
            ['skill_type_id' => 2, 'name' => 'php'],
27
            ['skill_type_id' => 2, 'name' => 'git'],
28
            ['skill_type_id' => 2, 'name' => 'docker'],
29
            ['skill_type_id' => 2, 'name' => 'html'],
30
            ['skill_type_id' => 2, 'name' => 'sql'],
31
            ['skill_type_id' => 2, 'name' => 'open_source'],
32
            ['skill_type_id' => 2, 'name' => 'verbal_communication'],
33
            ['skill_type_id' => 2, 'name' => 'written_communication'],
34
            ['skill_type_id' => 2, 'name' => 'ability_distributed_team'],
35
            ['skill_type_id' => 1, 'name' => 'ability_learn'],
36
            ['skill_type_id' => 1, 'name' => 'integrity'],
37
            ['skill_type_id' => 1, 'name' => 'ability_collaborate'],
38
            ['skill_type_id' => 1, 'name' => 'initiative'],
39
            ['skill_type_id' => 1, 'name' => 'humility'],
40
            ['skill_type_id' => 1, 'name' => 'passion'],
41
            ['skill_type_id' => 1, 'name' => 'flexibility'],
42
            ['skill_type_id' => 1, 'name' => 'judgement'],
43
            ['skill_type_id' => 1, 'name' => 'adaptability'],
44
            ['skill_type_id' => 1, 'name' => 'accountability'],
45
            ['skill_type_id' => 1, 'name' => 'attention_detail'],
46
            ['skill_type_id' => 1, 'name' => 'complex_problem_solving'],
47
            ['skill_type_id' => 1, 'name' => 'courage'],
48
            ['skill_type_id' => 1, 'name' => 'originality'],
49
            ['skill_type_id' => 1, 'name' => 'critical_thinking'],
50
            ['skill_type_id' => 1, 'name' => 'curiosity'],
51
            ['skill_type_id' => 1, 'name' => 'dependability'],
52
            ['skill_type_id' => 1, 'name' => 'ability_follow_instructions'],
53
            ['skill_type_id' => 1, 'name' => 'persistence'],
54
            ['skill_type_id' => 1, 'name' => 'resilience'],
55
            ['skill_type_id' => 1, 'name' => 'service_orientation'],
56
            ['skill_type_id' => 1, 'name' => 'social_perceptiveness'],
57
            ['skill_type_id' => 1, 'name' => 'stress_management'],
58
            ['skill_type_id' => 1, 'name' => 'stress_tolerance'],
59
            ['skill_type_id' => 1, 'name' => 'time_management'],
60
            ['skill_type_id' => 1, 'name' => 'willingness_learn'],
61
            ['skill_type_id' => 2, 'name' => 'management_ability'],
62
            ['skill_type_id' => 2, 'name' => 'experience_design'],
63
            ['skill_type_id' => 2, 'name' => 'project_management'],
64
            ['skill_type_id' => 2, 'name' => 'stakeholder_relations'],
65
            ['skill_type_id' => 2, 'name' => 'dot_net'],
66
            ['skill_type_id' => 2, 'name' => 'geospacial_programming'],
67
            ['skill_type_id' => 2, 'name' => 'microsoft_dynamics'],
68
            ['skill_type_id' => 2, 'name' => 'facilitation'],
69
            ['skill_type_id' => 2, 'name' => 'systems_thinking'],
70
            ['skill_type_id' => 2, 'name' => 'web_architecture'],
71
            ['skill_type_id' => 2, 'name' => 'storytelling'],
72
            ['skill_type_id' => 2, 'name' => 'user_design'],
73
            ['skill_type_id' => 1, 'name' => 'empathy'],
74
            ['skill_type_id' => 2, 'name' => 'analysis'],
75
            ['skill_type_id' => 2, 'name' => 'data_science'],
76
            ['skill_type_id' => 1, 'name' => 'results_oriented'],
77
            ['skill_type_id' => 1, 'name' => 'relationship_management'],
78
            ['skill_type_id' => 2, 'name' => 'data_analysis'],
79
            ['skill_type_id' => 2, 'name' => 'data_mining'],
80
            ['skill_type_id' => 2, 'name' => 'r_programming'],
81
            ['skill_type_id' => 2, 'name' => 'database_design_and_management'],
82
            ['skill_type_id' => 2, 'name' => 'scrum'],
83
            ['skill_type_id' => 2, 'name' => 'team_foundation_server'],
84
            ['skill_type_id' => 2, 'name' => 'n_unit_testing'],
85
            ['skill_type_id' => 2, 'name' => 'asp_net_mvc'],
86
            ['skill_type_id' => 2, 'name' => 'ef6'],
87
            ['skill_type_id' => 2, 'name' => 'cloud_architecture_for_mobile_and_applications'],
88
            ['skill_type_id' => 2, 'name' => 'cloud_computing_platform_configuration'],
89
            ['skill_type_id' => 2, 'name' => 'strategy_development'],
90
        ]);
91
    }
92
93
    /**
94
    * Reverse the migrations.
95
    *
96
    * @return void
97
    */
98
    public function down()
99
    {
100
        DB::table('skills')->whereIn('name',
101
        [
102
            'front_end_dev',
103
            'web_programming',
104
            'server_admin',
105
            'linux',
106
            'css',
107
            'javascript',
108
            'c_plus_plus',
109
            'sass',
110
            'python',
111
            'php',
112
            'git',
113
            'docker',
114
            'html',
115
            'sql',
116
            'open_source',
117
            'verbal_communication',
118
            'written_communication',
119
            'ability_distributed_team',
120
            'ability_learn',
121
            'integrity',
122
            'ability_collaborate',
123
            'initiative',
124
            'humility',
125
            'passion',
126
            'flexibility',
127
            'judgement',
128
            'adaptability',
129
            'accountability',
130
            'attention_detail',
131
            'complex_problem_solving',
132
            'courage',
133
            'originality',
134
            'critical_thinking',
135
            'curiosity',
136
            'dependability',
137
            'ability_follow_instructions',
138
            'persistence',
139
            'resilience',
140
            'service_orientation',
141
            'social_perceptiveness',
142
            'stress_management',
143
            'stress_tolerance',
144
            'time_management',
145
            'willingness_learn',
146
            'management_ability',
147
            'experience_design',
148
            'project_management',
149
            'stakeholder_relations',
150
            'dot_net',
151
            'geospacial_programming',
152
            'microsoft_dynamics',
153
            'facilitation',
154
            'systems_thinking',
155
            'web_architecture',
156
            'storytelling',
157
            'user_design',
158
            'empathy',
159
            'analysis',
160
            'data_science',
161
            'results_oriented',
162
            'relationship_management',
163
            'data_analysis',
164
            'data_mining',
165
            'r_programming',
166
            'database_design_and_management',
167
            'scrum',
168
            'team_foundation_server',
169
            'n_unit_testing',
170
            'asp_net_mvc',
171
            'ef6',
172
            'cloud_architecture_for_mobile_and_applications',
173
            'cloud_computing_platform_configuration',
174
            'strategy_development',
175
        ])->delete();
176
    }
177
}
178