Code Duplication    Length = 5-5 lines in 3 locations

courses/update-courses.php 1 location

@@ 52-56 (lines=5) @@
49
                        $params['name'] = $course['long_name'];
50
                    }
51
52
                    if (!empty($course['short_name'])) {
53
                        $params['course_code'] = $course['short_name'];
54
                    } elseif (!empty($params['name'])) {
55
                        $params['course_code'] = $params['name'];
56
                    }
57
58
                    if (!empty($course['term_id'])) {
59
                        $params['term_id'] = "sis_term_id:{$course['term_id']}";

courses/create-courses.php 2 locations

@@ 138-142 (lines=5) @@
135
                    $params['name'] = $course['long_name'];
136
                }
137
138
                if (!empty($course['short_name'])) {
139
                    $params['course_code'] = $course['short_name'];
140
                } elseif (!empty($params['name'])) {
141
                    $params['course_code'] = $params['name'];
142
                }
143
144
                if (!empty($course['account_id'])) {
145
                    $_account = "sis_account_id:{$course['account_id']}";
@@ 150-154 (lines=5) @@
147
                    $_account = $account;
148
                }
149
150
                if (!empty($course['term_id'])) {
151
                    $params['term_id'] = "sis_term_id:{$course['term_id']}";
152
                } elseif (!empty($term)) {
153
                    $params['term_id'] = $term;
154
                }
155
156
                if (!empty($course['start_at'])) {
157
                    $params['start_at'] = $course['start_at'];