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 = 11-16 lines in 10 locations

src/Storage.php 10 locations

@@ 62-77 (lines=16) @@
59
        return $userList;
60
    }
61
62
    public function getUserCertificateInfo($commonName)
63
    {
64
        $stmt = $this->db->prepare(
65
            'SELECT 
66
                u.external_user_id AS user_id, 
67
                u.is_disabled AS user_is_disabled,
68
                c.display_name AS display_name,
69
                c.is_disabled AS certificate_is_disabled 
70
             FROM 
71
                users u, certificates c 
72
             WHERE 
73
                u.user_id = c.user_id AND 
74
                c.common_name = :common_name'
75
        );
76
77
        $stmt->bindValue(':common_name', $commonName, PDO::PARAM_STR);
78
        $stmt->execute();
79
80
        return $stmt->fetch(PDO::FETCH_ASSOC);
@@ 225-235 (lines=11) @@
222
        return 1 === $stmt->rowCount();
223
    }
224
225
    public function deleteUser($externalUserId)
226
    {
227
        $stmt = $this->db->prepare(
228
            'DELETE FROM users WHERE external_user_id = :external_user_id'
229
        );
230
        $stmt->bindValue(':external_user_id', $externalUserId, PDO::PARAM_STR);
231
232
        $stmt->execute();
233
234
        return 1 === $stmt->rowCount();
235
    }
236
237
    public function addCertificate($externalUserId, $commonName, $displayName, $validFrom, $validTo)
238
    {
@@ 279-289 (lines=11) @@
276
        return $certificateList;
277
    }
278
279
    public function disableCertificate($commonName)
280
    {
281
        $stmt = $this->db->prepare(
282
            'UPDATE certificates SET is_disabled = 1 WHERE common_name = :common_name'
283
        );
284
        $stmt->bindValue(':common_name', $commonName, PDO::PARAM_STR);
285
286
        $stmt->execute();
287
288
        return 1 === $stmt->rowCount();
289
    }
290
291
    public function deleteCertificate($commonName)
292
    {
@@ 291-301 (lines=11) @@
288
        return 1 === $stmt->rowCount();
289
    }
290
291
    public function deleteCertificate($commonName)
292
    {
293
        $stmt = $this->db->prepare(
294
            'DELETE FROM certificates WHERE common_name = :common_name'
295
        );
296
        $stmt->bindValue(':common_name', $commonName, PDO::PARAM_STR);
297
298
        $stmt->execute();
299
300
        return 1 === $stmt->rowCount();
301
    }
302
303
    public function enableCertificate($commonName)
304
    {
@@ 303-315 (lines=13) @@
300
        return 1 === $stmt->rowCount();
301
    }
302
303
    public function enableCertificate($commonName)
304
    {
305
        $stmt = $this->db->prepare(
306
            'UPDATE certificates SET is_disabled = 0 WHERE common_name = :common_name'
307
        );
308
        $stmt->bindValue(':common_name', $commonName, PDO::PARAM_STR);
309
310
        $stmt->execute();
311
312
        return 1 === $stmt->rowCount();
313
    }
314
315
    public function disableUser($externalUserId)
316
    {
317
        $stmt = $this->db->prepare(
318
            'UPDATE users SET is_disabled = 1 WHERE external_user_id = :external_user_id'
@@ 315-327 (lines=13) @@
312
        return 1 === $stmt->rowCount();
313
    }
314
315
    public function disableUser($externalUserId)
316
    {
317
        $stmt = $this->db->prepare(
318
            'UPDATE users SET is_disabled = 1 WHERE external_user_id = :external_user_id'
319
        );
320
        $stmt->bindValue(':external_user_id', $externalUserId, PDO::PARAM_STR);
321
322
        $stmt->execute();
323
324
        // XXX it seems on update the rowCount is always 1, even if nothing was
325
        // modified?
326
        return 1 === $stmt->rowCount();
327
    }
328
329
    public function enableUser($externalUserId)
330
    {
@@ 329-341 (lines=13) @@
326
        return 1 === $stmt->rowCount();
327
    }
328
329
    public function enableUser($externalUserId)
330
    {
331
        $stmt = $this->db->prepare(
332
            'UPDATE users SET is_disabled = 0 WHERE external_user_id = :external_user_id'
333
        );
334
        $stmt->bindValue(':external_user_id', $externalUserId, PDO::PARAM_STR);
335
336
        $stmt->execute();
337
338
        // XXX it seems on update the rowCount is always 1, even if nothing was
339
        // modified?
340
        return 1 === $stmt->rowCount();
341
    }
342
343
    public function isDisabledUser($externalUserId)
344
    {
@@ 435-450 (lines=16) @@
432
        return 1 === $stmt->rowCount();
433
    }
434
435
    public function getLogEntry($dateTimeUnix, $ipAddress)
436
    {
437
        $stmt = $this->db->prepare(
438
            'SELECT profile_id, common_name, ip4, ip6, connected_at, disconnected_at
439
             FROM connection_log
440
             WHERE
441
                (ip4 = :ip_address OR ip6 = :ip_address)
442
                AND connected_at < :date_time_unix
443
                AND (disconnected_at > :date_time_unix OR disconnected_at IS NULL)'
444
        );
445
        $stmt->bindValue(':ip_address', $ipAddress, PDO::PARAM_STR);
446
        $stmt->bindValue(':date_time_unix', $dateTimeUnix, PDO::PARAM_STR);
447
        $stmt->execute();
448
449
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
450
    }
451
452
    public function recordTotpKey($externalUserId, $totpKey, $timeUnix)
453
    {
@@ 482-494 (lines=13) @@
479
        return true;
480
    }
481
482
    public function cleanConnectionLog($timeUnix)
483
    {
484
        $stmt = $this->db->prepare(
485
            sprintf(
486
                'DELETE FROM connection_log
487
                    WHERE connected_at < :time_unix'
488
            )
489
        );
490
491
        $stmt->bindValue(':time_unix', $timeUnix, PDO::PARAM_INT);
492
493
        return $stmt->execute();
494
    }
495
496
    public function cleanTotpLog($timeUnix)
497
    {
@@ 496-508 (lines=13) @@
493
        return $stmt->execute();
494
    }
495
496
    public function cleanTotpLog($timeUnix)
497
    {
498
        $stmt = $this->db->prepare(
499
            sprintf(
500
                'DELETE FROM totp_log
501
                    WHERE time_unix < :time_unix'
502
            )
503
        );
504
505
        $stmt->bindValue(':time_unix', $timeUnix, PDO::PARAM_INT);
506
507
        return $stmt->execute();
508
    }
509
510
    public function motd()
511
    {