GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 19-30 lines in 3 locations

phpmyfaq/src/phpMyFAQ/Session.php 2 locations

@@ 161-183 (lines=23) @@
158
     *
159
     * @return int
160
     */
161
    public function getTimeFromSessionId(int $sid)
162
    {
163
        $timestamp = 0;
164
165
        $query = sprintf('
166
            SELECT
167
                time
168
            FROM
169
                %sfaqsessions
170
            WHERE
171
                sid = %d',
172
            Db::getTablePrefix(),
173
            $sid);
174
175
        $result = $this->config->getDb()->query($query);
176
177
        if ($result) {
178
            $res = $this->config->getDb()->fetchObject($result);
179
            $timestamp = $res->time;
180
        }
181
182
        return $timestamp;
183
    }
184
185
    /**
186
     * Returns all session from a date.
@@ 229-247 (lines=19) @@
226
     *
227
     * @return int
228
     */
229
    public function getNumberOfSessions(): int
230
    {
231
        $num = 0;
232
233
        $query = sprintf('
234
            SELECT
235
                COUNT(sid) as num_sessions
236
            FROM
237
                %sfaqsessions',
238
            Db::getTablePrefix());
239
240
        $result = $this->config->getDb()->query($query);
241
        if ($result) {
242
            $row = $this->config->getDb()->fetchObject($result);
243
            $num = $row->num_sessions;
244
        }
245
246
        return $num;
247
    }
248
249
    /**
250
     * Deletes the sessions for a given timespan.

phpmyfaq/src/phpMyFAQ/Tags.php 1 location

@@ 137-166 (lines=30) @@
134
     *
135
     * @return array
136
     */
137
    public function getAllTagsById($recordId)
138
    {
139
        $tags = [];
140
141
        $query = sprintf('
142
            SELECT
143
                dt.tagging_id AS tagging_id, 
144
                t.tagging_name AS tagging_name
145
            FROM
146
                %sfaqdata_tags dt, %sfaqtags t
147
            WHERE
148
                dt.record_id = %d
149
            AND
150
                dt.tagging_id = t.tagging_id
151
            ORDER BY
152
                t.tagging_name',
153
            Db::getTablePrefix(),
154
            Db::getTablePrefix(),
155
            $recordId
156
        );
157
158
        $result = $this->config->getDb()->query($query);
159
        if ($result) {
160
            while ($row = $this->config->getDb()->fetchObject($result)) {
161
                $tags[$row->tagging_id] = $row->tagging_name;
162
            }
163
        }
164
165
        return $tags;
166
    }
167
168
    /**
169
     * Returns all tags for a FAQ record.