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 = 29-36 lines in 4 locations

phpmyfaq/src/phpMyFAQ/Permission/LargePermission.php 1 location

@@ 390-418 (lines=29) @@
387
     * @param int $sectionId
388
     * @return array
389
     */
390
    public function getSectionGroups($sectionId)
391
    {
392
        if ($sectionId <= 0 || !is_numeric($sectionId)) {
393
            return [];
394
        }
395
396
        $select = sprintf('
397
            SELECT 
398
                %sfaqsection_group.group_id
399
            FROM
400
                %sfaqsection_group
401
            WHERE 
402
                %sfaqsection_group.section_id = %d
403
            ',
404
            Db::getTablePrefix(),
405
            Db::getTablePrefix(),
406
            Db::getTablePrefix(),
407
            $sectionId
408
        );
409
410
        $res = $this->config->getDb()->query($select);
411
412
        $result = [];
413
        while ($row = $this->config->getDb()->fetchArray($res)) {
414
            $result[] = $row['group_id'];
415
        }
416
417
        return $result;
418
    }
419
420
    /**
421
     * Adds a new group $groupId to the section $sectionId.

phpmyfaq/src/phpMyFAQ/Permission/MediumPermission.php 3 locations

@@ 115-145 (lines=31) @@
112
     * 
113
     * @return array
114
     */
115
    public function getGroupRights($groupId)
116
    {
117
        if ($groupId <= 0 || !is_numeric($groupId)) {
118
            return [];
119
        }
120
        // check right
121
        $select = sprintf('
122
            SELECT
123
                fr.right_id AS right_id
124
            FROM
125
                %sfaqright fr,
126
                %sfaqgroup_right fgr,
127
                %sfaqgroup fg
128
            WHERE
129
                fg.group_id = %d AND
130
                fg.group_id = fgr.group_id AND
131
                fr.right_id = fgr.right_id',
132
            Db::getTablePrefix(),
133
            Db::getTablePrefix(),
134
            Db::getTablePrefix(),
135
            $groupId
136
        );
137
138
        $res = $this->config->getDb()->query($select);
139
        $result = [];
140
        while ($row = $this->config->getDb()->fetchArray($res)) {
141
            $result[] = $row['right_id'];
142
        }
143
144
        return $result;
145
    }
146
147
    /**
148
     * Returns true, if the user given by $userId owns the right
@@ 450-480 (lines=31) @@
447
     *
448
     * @return array
449
     */
450
    public function getGroupMembers($groupId)
451
    {
452
        if ($groupId <= 0 || !is_numeric($groupId)) {
453
            return [];
454
        }
455
456
        $select = sprintf('
457
            SELECT
458
                fu.user_id AS user_id
459
            FROM
460
                %sfaquser fu,
461
                %sfaquser_group fug,
462
                %sfaqgroup fg
463
            WHERE
464
                fg.group_id = %d AND
465
                fg.group_id = fug.group_id AND
466
                fu.user_id  = fug.user_id',
467
            Db::getTablePrefix(),
468
            Db::getTablePrefix(),
469
            Db::getTablePrefix(),
470
            $groupId
471
        );
472
473
        $res = $this->config->getDb()->query($select);
474
        $result = [];
475
        while ($row = $this->config->getDb()->fetchArray($res)) {
476
            $result[] = $row['user_id'];
477
        }
478
479
        return $result;
480
    }
481
482
    /**
483
     * Adds a new member $userId to the group $groupId.
@@ 906-941 (lines=36) @@
903
     *
904
     * @return array
905
     */
906
    public function getUserGroupRights($userId)
907
    {
908
        if ($userId <= 0 || !is_numeric($userId)) {
909
            return [];
910
        }
911
912
        $select = sprintf('
913
            SELECT
914
                fr.right_id AS right_id
915
            FROM
916
                %sfaqright fr,
917
                %sfaqgroup_right fgr,
918
                %sfaqgroup fg,
919
                %sfaquser_group fug,
920
                %sfaquser fu
921
            WHERE
922
                fu.user_id  = %d AND
923
                fu.user_id  = fug.user_id AND
924
                fg.group_id = fug.group_id AND
925
                fg.group_id = fgr.group_id AND
926
                fr.right_id = fgr.right_id',
927
            Db::getTablePrefix(),
928
            Db::getTablePrefix(),
929
            Db::getTablePrefix(),
930
            Db::getTablePrefix(),
931
            Db::getTablePrefix(),
932
            $userId);
933
934
        $res = $this->config->getDb()->query($select);
935
        $result = [];
936
        while ($row = $this->config->getDb()->fetchArray($res)) {
937
            $result[] = $row['right_id'];
938
        }
939
940
        return $result;
941
    }
942
943
    /**
944
     * Refuses all group rights.