| Conditions | 1 |
| Paths | 1 |
| Total Lines | 179 |
| Code Lines | 150 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
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:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 110 | private function getTablesToConvert(): array |
||
| 111 | { |
||
| 112 | return [ |
||
| 113 | // Main |
||
| 114 | 'access_url', |
||
| 115 | 'agenda_reminder', |
||
| 116 | 'block', |
||
| 117 | 'branch_sync', |
||
| 118 | 'branch_transaction', |
||
| 119 | 'branch_transaction_status', |
||
| 120 | 'career', |
||
| 121 | 'chat', |
||
| 122 | 'chat_video', |
||
| 123 | 'course', |
||
| 124 | 'course_category', |
||
| 125 | 'course_rel_class', |
||
| 126 | 'course_request', |
||
| 127 | 'course_type', |
||
| 128 | |||
| 129 | // Course tables (single DB schema in C2) |
||
| 130 | 'c_announcement', |
||
| 131 | 'c_announcement_attachment', |
||
| 132 | 'c_attendance', |
||
| 133 | 'c_attendance_sheet', |
||
| 134 | 'c_attendance_sheet_log', |
||
| 135 | 'c_blog', |
||
| 136 | 'c_blog_attachment', |
||
| 137 | 'c_blog_comment', |
||
| 138 | 'c_blog_post', |
||
| 139 | 'c_blog_rating', |
||
| 140 | 'c_blog_task', |
||
| 141 | 'c_calendar_event', |
||
| 142 | 'c_calendar_event_attachment', |
||
| 143 | 'c_calendar_event_repeat', |
||
| 144 | 'c_course_description', |
||
| 145 | 'c_course_setting', |
||
| 146 | 'c_document', |
||
| 147 | 'c_dropbox_category', |
||
| 148 | 'c_dropbox_feedback', |
||
| 149 | 'c_dropbox_file', |
||
| 150 | 'c_dropbox_post', |
||
| 151 | 'c_forum_attachment', |
||
| 152 | 'c_forum_category', |
||
| 153 | 'c_forum_forum', |
||
| 154 | 'c_forum_post', |
||
| 155 | 'c_forum_thread', |
||
| 156 | 'c_glossary', |
||
| 157 | 'c_group_category', |
||
| 158 | 'c_group_info', |
||
| 159 | 'c_group_rel_user', |
||
| 160 | 'c_link', |
||
| 161 | 'c_link_category', |
||
| 162 | 'c_lp', |
||
| 163 | 'c_lp_category', |
||
| 164 | 'c_lp_item', |
||
| 165 | 'c_lp_item_view', |
||
| 166 | 'c_lp_iv_interaction', |
||
| 167 | 'c_lp_iv_objective', |
||
| 168 | 'c_notebook', |
||
| 169 | 'c_quiz', |
||
| 170 | 'c_quiz_answer', |
||
| 171 | 'c_quiz_category', |
||
| 172 | 'c_quiz_question', |
||
| 173 | 'c_quiz_question_category', |
||
| 174 | 'c_quiz_question_option', |
||
| 175 | 'c_quiz_rel_question', |
||
| 176 | 'c_student_publication', |
||
| 177 | 'c_student_publication_comment', |
||
| 178 | 'c_survey', |
||
| 179 | 'c_survey_answer', |
||
| 180 | 'c_survey_invitation', |
||
| 181 | 'c_survey_question', |
||
| 182 | 'c_survey_question_option', |
||
| 183 | 'c_thematic', |
||
| 184 | 'c_thematic_advance', |
||
| 185 | 'c_thematic_plan', |
||
| 186 | 'c_tool', |
||
| 187 | 'c_tool_intro', |
||
| 188 | 'c_wiki', |
||
| 189 | 'c_wiki_conf', |
||
| 190 | 'c_wiki_discuss', |
||
| 191 | 'c_wiki_mailcue', |
||
| 192 | |||
| 193 | // Extra fields / settings |
||
| 194 | 'extra_field', |
||
| 195 | 'extra_field_options', |
||
| 196 | 'extra_field_saved_search', |
||
| 197 | 'extra_field_values', |
||
| 198 | 'ext_log_entries', |
||
| 199 | 'fos_group', |
||
| 200 | |||
| 201 | // Gradebook |
||
| 202 | 'gradebook_category', |
||
| 203 | 'gradebook_certificate', |
||
| 204 | 'gradebook_evaluation', |
||
| 205 | 'gradebook_link', |
||
| 206 | 'gradebook_linkeval_log', |
||
| 207 | 'gradebook_score_display', |
||
| 208 | 'grade_components', |
||
| 209 | 'grade_model', |
||
| 210 | |||
| 211 | // Misc |
||
| 212 | 'language', |
||
| 213 | 'legal', |
||
| 214 | 'message_attachment', |
||
| 215 | 'portfolio', |
||
| 216 | 'portfolio_category', |
||
| 217 | 'promotion', |
||
| 218 | 'room', |
||
| 219 | 'scheduled_announcements', |
||
| 220 | 'search_engine_ref', |
||
| 221 | |||
| 222 | // Sequence |
||
| 223 | 'sequence', |
||
| 224 | 'sequence_condition', |
||
| 225 | 'sequence_method', |
||
| 226 | 'sequence_row_entity', |
||
| 227 | 'sequence_rule', |
||
| 228 | 'sequence_type_entity', |
||
| 229 | 'sequence_variable', |
||
| 230 | |||
| 231 | // Sessions / settings |
||
| 232 | 'session', |
||
| 233 | 'session_category', |
||
| 234 | 'settings', |
||
| 235 | 'settings_options', |
||
| 236 | |||
| 237 | // Skills |
||
| 238 | 'skill', |
||
| 239 | 'skill_level', |
||
| 240 | 'skill_level_profile', |
||
| 241 | 'skill_profile', |
||
| 242 | 'skill_rel_gradebook', |
||
| 243 | 'skill_rel_item', |
||
| 244 | 'skill_rel_user', |
||
| 245 | 'skill_rel_user_comment', |
||
| 246 | |||
| 247 | // Specific fields |
||
| 248 | 'specific_field', |
||
| 249 | 'specific_field_values', |
||
| 250 | |||
| 251 | // Templates / announcements |
||
| 252 | 'system_template', |
||
| 253 | 'sys_announcement', |
||
| 254 | 'tag', |
||
| 255 | 'templates', |
||
| 256 | |||
| 257 | // Tickets |
||
| 258 | 'ticket_category', |
||
| 259 | 'ticket_message', |
||
| 260 | 'ticket_message_attachments', |
||
| 261 | 'ticket_priority', |
||
| 262 | 'ticket_project', |
||
| 263 | 'ticket_status', |
||
| 264 | 'ticket_ticket', |
||
| 265 | |||
| 266 | // Tool rights |
||
| 267 | 'tool', |
||
| 268 | 'tool_resource_right', |
||
| 269 | |||
| 270 | // Tracking |
||
| 271 | 'track_e_access', |
||
| 272 | 'track_e_attempt', |
||
| 273 | 'track_e_course_access', |
||
| 274 | 'track_e_default', |
||
| 275 | 'track_e_downloads', |
||
| 276 | 'track_e_exercises', |
||
| 277 | 'track_e_hotpotatoes', |
||
| 278 | 'track_e_hotspot', |
||
| 279 | 'track_e_lastaccess', |
||
| 280 | 'track_e_login', |
||
| 281 | 'track_e_online', |
||
| 282 | |||
| 283 | // Users |
||
| 284 | 'user', |
||
| 285 | 'usergroup', |
||
| 286 | 'user_api_key', |
||
| 287 | 'user_course_category', |
||
| 288 | 'user_friend_relation_type', |
||
| 289 | ]; |
||
| 318 |