Code Duplication    Length = 7-11 lines in 3 locations

application/models/Tracker_Model.php 3 locations

@@ 186-192 (lines=7) @@
183
			if(((int) $query->row('active')) === 0 && $query->row('status') === 0) {
184
				$titleData = $this->sites->{$query->row('site_class')}->getTitleData($query->row('title_url'));
185
				if(!is_null($titleData['latest_chapter'])) {
186
					if($this->updateTitleById((int) $id, $titleData['latest_chapter'])) {
187
						//Make sure last_checked is always updated on successful run.
188
						//CHECK: Is there a reason we aren't just doing this in updateTitleById?
189
						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
190
						         ->where('id', $id)
191
						         ->update('tracker_titles');
192
					}
193
				} else {
194
					log_message('error', "{$query->row('title')} failed to update successfully");
195
				}
@@ 370-378 (lines=9) @@
367
				if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
368
					//FIXME: "At the moment" we don't seem to be doing anything with TitleData['last_updated'].
369
					//       Should we even use this? Y/N
370
					if($this->updateTitleById((int) $row->id, $titleData['latest_chapter'])) {
371
						//Make sure last_checked is always updated on successful run.
372
						//CHECK: Is there a reason we aren't just doing this in updateTitleById?
373
						$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
374
						         ->where('id', $row->id)
375
						         ->update('tracker_titles');
376
377
						print " - ({$titleData['latest_chapter']})\n";
378
					}
379
				} else {
380
					log_message('error', "{$row->title} failed to update successfully");
381
					print " - FAILED TO PARSE\n";
@@ 397-407 (lines=11) @@
394
						if($dbTitleData = $this->getTitleID($titleURL, (int) $site['id'], FALSE, TRUE)) {
395
							if($this->sites->{$site['site_class']}->doCustomCheck($dbTitleData['latest_chapter'], $titleData['latest_chapter'])) {
396
								$titleID = $dbTitleData['id'];
397
								if($this->updateTitleById((int) $titleID, $titleData['latest_chapter'])) {
398
									//Make sure last_checked is always updated on successful run.
399
									//CHECK: Is there a reason we aren't just doing this in updateTitleById?
400
									$this->db->set('last_checked', 'CURRENT_TIMESTAMP', FALSE)
401
									         ->where('id', $titleID)
402
									         ->update('tracker_titles');
403
404
									print " - ({$titleData['latest_chapter']})\n";
405
								} else {
406
									print " - Title doesn't exist? ($titleID)\n";
407
								}
408
							} else {
409
								print " - Failed Check.\n";
410
							}