Code Duplication    Length = 12-13 lines in 7 locations

application/models/History_Model.php 7 locations

@@ 75-87 (lines=13) @@
72
	 * 8: Title ignored
73
	 */
74
75
	public function userAddTitle(int $chapterID, string $chapter, string $category) : bool {
76
		$success = $this->db->insert('tracker_user_history', [
77
			'chapter_id'  => $chapterID,
78
79
			'type'        => '1',
80
			'custom1'     => $chapter,
81
			'custom2'     => $category,
82
83
			'updated_at'  => date('Y-m-d H:i:s')
84
		]);
85
86
		return $success;
87
	}
88
	public function userUpdateTitle(int $chapterID, string $new_chapter) : bool {
89
		$success = $this->db->insert('tracker_user_history', [
90
			'chapter_id'  => $chapterID,
@@ 88-99 (lines=12) @@
85
86
		return $success;
87
	}
88
	public function userUpdateTitle(int $chapterID, string $new_chapter) : bool {
89
		$success = $this->db->insert('tracker_user_history', [
90
			'chapter_id'  => $chapterID,
91
92
			'type'        => '2',
93
			'custom1'     => $new_chapter,
94
95
			'updated_at'  => date('Y-m-d H:i:s')
96
		]);
97
98
		return $success;
99
	}
100
	public function userRemoveTitle(int $chapterID) : bool {
101
		$success = $this->db->insert('tracker_user_history', [
102
			'chapter_id'  => $chapterID,
@@ 111-122 (lines=12) @@
108
109
		return $success;
110
	}
111
	public function userUpdateTags(int $chapterID, string $new_tags) : bool {
112
		$success = $this->db->insert('tracker_user_history', [
113
			'chapter_id'  => $chapterID,
114
115
			'type'        => '4',
116
			'custom1'     => $new_tags,
117
118
			'updated_at'  => date('Y-m-d H:i:s')
119
		]);
120
121
		return $success;
122
	}
123
	public function userUpdateCategory(int $chapterID, string $new_category) : bool {
124
		$success = $this->db->insert('tracker_user_history', [
125
			'chapter_id'  => $chapterID,
@@ 123-134 (lines=12) @@
120
121
		return $success;
122
	}
123
	public function userUpdateCategory(int $chapterID, string $new_category) : bool {
124
		$success = $this->db->insert('tracker_user_history', [
125
			'chapter_id'  => $chapterID,
126
127
			'type'        => '5',
128
			'custom1'     => $new_category,
129
130
			'updated_at'  => date('Y-m-d H:i:s')
131
		]);
132
133
		return $success;
134
	}
135
	public function userAddFavourite(int $chapterID, string $chapter) : bool {
136
		$success = $this->db->insert('tracker_user_history', [
137
			'chapter_id'  => $chapterID,
@@ 135-146 (lines=12) @@
132
133
		return $success;
134
	}
135
	public function userAddFavourite(int $chapterID, string $chapter) : bool {
136
		$success = $this->db->insert('tracker_user_history', [
137
			'chapter_id'  => $chapterID,
138
139
			'type'        => '6',
140
			'custom1'     => $chapter,
141
142
			'updated_at'  => date('Y-m-d H:i:s')
143
		]);
144
145
		return $success;
146
	}
147
	public function userRemoveFavourite(int $chapterID, string $chapter) : bool {
148
		$success = $this->db->insert('tracker_user_history', [
149
			'chapter_id'  => $chapterID,
@@ 147-158 (lines=12) @@
144
145
		return $success;
146
	}
147
	public function userRemoveFavourite(int $chapterID, string $chapter) : bool {
148
		$success = $this->db->insert('tracker_user_history', [
149
			'chapter_id'  => $chapterID,
150
151
			'type'        => '7',
152
			'custom1'     => $chapter,
153
154
			'updated_at'  => date('Y-m-d H:i:s')
155
		]);
156
157
		return $success;
158
	}
159
	public function userIgnoreTitle(int $chapterID, string $new_chapter) : bool {
160
		$success = $this->db->insert('tracker_user_history', [
161
			'chapter_id'  => $chapterID,
@@ 159-170 (lines=12) @@
156
157
		return $success;
158
	}
159
	public function userIgnoreTitle(int $chapterID, string $new_chapter) : bool {
160
		$success = $this->db->insert('tracker_user_history', [
161
			'chapter_id'  => $chapterID,
162
163
			'type'        => '8',
164
			'custom1'     => $new_chapter,
165
166
			'updated_at'  => date('Y-m-d H:i:s')
167
		]);
168
169
		return $success;
170
	}
171
172
	public function userGetHistory(int $page) : array {
173
		$rowsPerPage = 50;