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

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