Code Duplication    Length = 42-42 lines in 2 locations

application/models/History_Model.php 2 locations

@@ 200-241 (lines=42) @@
197
				$arrRow['site'] = $row->site;
198
				$arrRow['site_sprite'] = str_replace('.', '-', $row->site);
199
200
				switch($row->type) {
201
					case 1:
202
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
203
						$arrRow['status'] = "Series added at '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>' to category '{$row->custom2}'";
204
						break;
205
206
					case 2:
207
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
208
						$arrRow['status'] = "Chapter updated to '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
209
						break;
210
211
					case 3:
212
						$arrRow['status'] = "Series removed";
213
						break;
214
215
					case 4:
216
						$arrRow['status'] = "Tags set to '{$row->custom1}'";
217
						break;
218
219
					case 5:
220
						$arrRow['status'] = "Category set to '{$row->custom1}'";
221
						break;
222
223
					case 6:
224
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
225
						$arrRow['status'] = "Favourited '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
226
						break;
227
228
					case 7:
229
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
230
						$arrRow['status'] = "Unfavourited '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
231
						break;
232
233
					case 8:
234
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
235
						$arrRow['status'] = "Chapter ignored: '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
236
						break;
237
238
					default:
239
						$arrRow['status'] = "Something went wrong!";
240
						break;
241
				}
242
				$arr['rows'][] = $arrRow;
243
			}
244
			$arr['totalPages'] = ceil($this->db->query('SELECT FOUND_ROWS() count;')->row()->count / $rowsPerPage);
@@ 275-316 (lines=42) @@
272
273
				$arrRow['site'] = $row->site;
274
275
				switch($row->type) {
276
					case 1:
277
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
278
						$arrRow['status'] = "Series added at '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>' to category '{$row->custom2}'";
279
						break;
280
281
					case 2:
282
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
283
						$arrRow['status'] = "Chapter updated to '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
284
						break;
285
286
					case 3:
287
						$arrRow['status'] = "Series removed";
288
						break;
289
290
					case 4:
291
						$arrRow['status'] = "Tags set to '{$row->custom1}'";
292
						break;
293
294
					case 5:
295
						$arrRow['status'] = "Category set to '{$row->custom1}'";
296
						break;
297
298
					case 6:
299
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
300
						$arrRow['status'] = "Favourited '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
301
						break;
302
303
					case 7:
304
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
305
						$arrRow['status'] = "Unfavourited '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
306
						break;
307
308
					case 8:
309
						$chapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->custom1);
310
						$arrRow['status'] = "Chapter ignored: '<a href=\"{$chapterData['url']}\">{$chapterData['number']}</a>'";
311
						break;
312
313
					default:
314
						$arrRow['status'] = "Something went wrong!";
315
						break;
316
				}
317
				$arr[] = $arrRow;
318
			}
319
		}