Code Duplication    Length = 17-20 lines in 2 locations

typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php 2 locations

@@ 1168-1187 (lines=20) @@
1165
        // Evaluate regularly indexed pages based on item_type:
1166
        // External media:
1167
        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('index_grlist');
1168
        if ($row['item_type']) {
1169
            // For external media we will check the access of the parent page on which the media was linked from.
1170
            // "phash_t3" is the phash of the parent TYPO3 page row which initiated the indexing of the documents
1171
            // in this section. So, selecting for the grlist records belonging to the parent phash-row where the
1172
            // current users gr_list exists will help us to know. If this is NOT found, there is still a theoretical
1173
            // possibility that another user accessible page would display a link, so maybe the resume of such a
1174
            // document here may be unjustified hidden. But better safe than sorry.
1175
            if (!$this->isTableUsed('index_grlist')) {
1176
                return false;
1177
            }
1178
1179
            return (bool)$connection->count(
1180
                'phash',
1181
                'index_grlist',
1182
                [
1183
                    'phash' => (int)$row['phash_t3'],
1184
                    'gr_list' => $this->frontendUserGroupList
1185
                ]
1186
            );
1187
        }
1188
        // Ordinary TYPO3 pages:
1189
        if ((string)$row['gr_list'] !== (string)$this->frontendUserGroupList) {
1190
            // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists.
@@ 1189-1205 (lines=17) @@
1186
            );
1187
        }
1188
        // Ordinary TYPO3 pages:
1189
        if ((string)$row['gr_list'] !== (string)$this->frontendUserGroupList) {
1190
            // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists.
1191
            // If it is found it is proof that this user has direct access to the phash-rows content although
1192
            // he did not himself initiate the indexing...
1193
            if (!$this->isTableUsed('index_grlist')) {
1194
                return false;
1195
            }
1196
1197
            return (bool)$connection->count(
1198
                    'phash',
1199
                    'index_grlist',
1200
                    [
1201
                        'phash' => (int)$row['phash'],
1202
                        'gr_list' => $this->frontendUserGroupList
1203
                    ]
1204
                );
1205
        }
1206
        return true;
1207
    }
1208