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
    {
@@ 448-463 (lines=16) @@
445
        return 1 === $stmt->rowCount();
446
    }
447
448
    public function getLogEntry($dateTimeUnix, $ipAddress)
449
    {
450
        $stmt = $this->db->prepare(
451
            'SELECT 
452
                 external_user_id AS user_id, 
453
                 profile_id, 
454
                 common_name, 
455
                 ip4, 
456
                 ip6, 
457
                 connected_at, 
458
                 disconnected_at
459
             FROM
460
                 connection_log
461
             WHERE
462
                (ip4 = :ip_address OR ip6 = :ip_address)
463
             AND 
464
                connected_at < :date_time_unix
465
             AND 
466
                (disconnected_at > :date_time_unix OR disconnected_at IS NULL)'
@@ 505-517 (lines=13) @@
502
        return true;
503
    }
504
505
    public function cleanConnectionLog($timeUnix)
506
    {
507
        $stmt = $this->db->prepare(
508
            sprintf(
509
                'DELETE FROM connection_log
510
                 WHERE
511
                     connected_at < :time_unix
512
                 AND
513
                     disconnected_at IS NOT NULL'
514
            )
515
        );
516
517
        $stmt->bindValue(':time_unix', $timeUnix, PDO::PARAM_INT);
518
519
        return $stmt->execute();
520
    }
@@ 522-534 (lines=13) @@
519
        return $stmt->execute();
520
    }
521
522
    public function cleanTotpLog($timeUnix)
523
    {
524
        $stmt = $this->db->prepare(
525
            sprintf(
526
                'DELETE FROM totp_log
527
                    WHERE time_unix < :time_unix'
528
            )
529
        );
530
531
        $stmt->bindValue(':time_unix', $timeUnix, PDO::PARAM_INT);
532
533
        return $stmt->execute();
534
    }
535
536
    public function motd()
537
    {