Code Duplication    Length = 10-11 lines in 4 locations

typo3/sysext/core/Classes/Database/QueryGenerator.php 2 locations

@@ 912-921 (lines=10) @@
909
                        $useSelectLabels = true;
910
                    }
911
                    $altLabelFieldSelect = [];
912
                    if ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items']) {
913
                        foreach ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items'] as $altLabelArray) {
914
                            if (substr($altLabelArray[0], 0, 4) === 'LLL:') {
915
                                $altLabelFieldSelect[$altLabelArray[1]] = $languageService->sL($altLabelArray[0]);
916
                            } else {
917
                                $altLabelFieldSelect[$altLabelArray[1]] = $altLabelArray[0];
918
                            }
919
                        }
920
                        $useAltSelectLabels = true;
921
                    }
922
923
                    if (!$this->tableArray[$from_table]) {
924
                        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($from_table);
@@ 901-910 (lines=10) @@
898
                if (is_array($GLOBALS['TCA'][$from_table])) {
899
                    $labelField = $GLOBALS['TCA'][$from_table]['ctrl']['label'];
900
                    $altLabelField = $GLOBALS['TCA'][$from_table]['ctrl']['label_alt'];
901
                    if ($GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items']) {
902
                        foreach ($GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items'] as $labelArray) {
903
                            if (substr($labelArray[0], 0, 4) === 'LLL:') {
904
                                $labelFieldSelect[$labelArray[1]] = $languageService->sL($labelArray[0]);
905
                            } else {
906
                                $labelFieldSelect[$labelArray[1]] = $labelArray[0];
907
                            }
908
                        }
909
                        $useSelectLabels = true;
910
                    }
911
                    $altLabelFieldSelect = [];
912
                    if ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items']) {
913
                        foreach ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items'] as $altLabelArray) {

typo3/sysext/core/Classes/Database/QueryView.php 2 locations

@@ 1039-1049 (lines=11) @@
1036
                if (is_array($GLOBALS['TCA'][$from_table])) {
1037
                    $labelField = $GLOBALS['TCA'][$from_table]['ctrl']['label'];
1038
                    $altLabelField = $GLOBALS['TCA'][$from_table]['ctrl']['label_alt'];
1039
                    if ($GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items']) {
1040
                        $items = $GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items'];
1041
                        foreach ($items as $labelArray) {
1042
                            if (substr($labelArray[0], 0, 4) === 'LLL:') {
1043
                                $labelFieldSelect[$labelArray[1]] = $this->languageService->sL($labelArray[0]);
1044
                            } else {
1045
                                $labelFieldSelect[$labelArray[1]] = $labelArray[0];
1046
                            }
1047
                        }
1048
                        $useSelectLabels = 1;
1049
                    }
1050
                    $altLabelFieldSelect = [];
1051
                    if ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items']) {
1052
                        $items = $GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items'];
@@ 1051-1061 (lines=11) @@
1048
                        $useSelectLabels = 1;
1049
                    }
1050
                    $altLabelFieldSelect = [];
1051
                    if ($GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items']) {
1052
                        $items = $GLOBALS['TCA'][$from_table]['columns'][$altLabelField]['config']['items'];
1053
                        foreach ($items as $altLabelArray) {
1054
                            if (substr($altLabelArray[0], 0, 4) === 'LLL:') {
1055
                                $altLabelFieldSelect[$altLabelArray[1]] = $this->languageService->sL($altLabelArray[0]);
1056
                            } else {
1057
                                $altLabelFieldSelect[$altLabelArray[1]] = $altLabelArray[0];
1058
                            }
1059
                        }
1060
                        $useAltSelectLabels = 1;
1061
                    }
1062
1063
                    if (!$this->tableArray[$from_table]) {
1064
                        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($from_table);