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 = 18-44 lines in 2 locations

src/Storage.php 2 locations

@@ 351-368 (lines=18) @@
348
        $stmt->execute();
349
    }
350
351
    public function addCertificate($userId, $commonName, $displayName, DateTime $validFrom, DateTime $validTo)
352
    {
353
        $this->addUser($userId);
354
        $stmt = $this->db->prepare(
355
<<< 'SQL'
356
    INSERT INTO certificates 
357
        (common_name, user_id, display_name, valid_from, valid_to)
358
    VALUES
359
        (:common_name, :user_id, :display_name, :valid_from, :valid_to)
360
SQL
361
        );
362
        $stmt->bindValue(':common_name', $commonName, PDO::PARAM_STR);
363
        $stmt->bindValue(':user_id', $userId, PDO::PARAM_STR);
364
        $stmt->bindValue(':display_name', $displayName, PDO::PARAM_STR);
365
        $stmt->bindValue(':valid_from', $validFrom->format('Y-m-d H:i:s'), PDO::PARAM_STR);
366
        $stmt->bindValue(':valid_to', $validTo->format('Y-m-d H:i:s'), PDO::PARAM_STR);
367
        $stmt->execute();
368
    }
369
370
    /**
371
     * @return array
@@ 531-574 (lines=44) @@
528
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
529
    }
530
531
    public function clientConnect($profileId, $commonName, $ip4, $ip6, DateTime $connectedAt)
532
    {
533
        // this query is so complex, because we want to store the user_id in the
534
        // log as well, not just the common_name... the user may delete the
535
        // certificate, or the user account may be deleted...
536
        $stmt = $this->db->prepare(
537
<<< 'SQL'
538
    INSERT INTO connection_log 
539
        (
540
            user_id,
541
            profile_id,
542
            common_name,
543
            ip4,
544
            ip6,
545
            connected_at
546
        ) 
547
    VALUES
548
        (
549
            (
550
                SELECT
551
                    u.user_id
552
                FROM 
553
                    users u, certificates c
554
                WHERE
555
                    u.user_id = c.user_id
556
                AND
557
                    c.common_name = :common_name
558
            ),                
559
            :profile_id, 
560
            :common_name,
561
            :ip4,
562
            :ip6,
563
            :connected_at
564
        )
565
SQL
566
        );
567
568
        $stmt->bindValue(':profile_id', $profileId, PDO::PARAM_STR);
569
        $stmt->bindValue(':common_name', $commonName, PDO::PARAM_STR);
570
        $stmt->bindValue(':ip4', $ip4, PDO::PARAM_STR);
571
        $stmt->bindValue(':ip6', $ip6, PDO::PARAM_STR);
572
        $stmt->bindValue(':connected_at', $connectedAt->format('Y-m-d H:i:s'), PDO::PARAM_STR);
573
        $stmt->execute();
574
    }
575
576
    public function clientDisconnect($profileId, $commonName, $ip4, $ip6, DateTime $connectedAt, DateTime $disconnectedAt, $bytesTransferred)
577
    {