Code Duplication    Length = 16-17 lines in 3 locations

src/PhpSpreadsheet/Reader/Xls.php 3 locations

@@ 7140-7155 (lines=16) @@
7137
        $row = self::getUInt2d($cellAddressStructure, 0) + 1;
7138
7139
        // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
7140
        if (!(0x4000 & self::getUInt2d($cellAddressStructure, 2))) {
7141
            // offset: 2; size: 2; index to column or column offset + relative flags
7142
            // bit: 7-0; mask 0x00FF; column index
7143
            $colIndex = 0x00FF & self::getUInt2d($cellAddressStructure, 2);
7144
7145
            $column = Coordinate::stringFromColumnIndex($colIndex + 1);
7146
            $column = '$' . $column;
7147
        } else {
7148
            // offset: 2; size: 2; index to column or column offset + relative flags
7149
            // bit: 7-0; mask 0x00FF; column index
7150
            $relativeColIndex = 0x00FF & self::getInt2d($cellAddressStructure, 2);
7151
            $colIndex = $baseCol + $relativeColIndex;
7152
            $colIndex = ($colIndex < 256) ? $colIndex : $colIndex - 256;
7153
            $colIndex = ($colIndex >= 0) ? $colIndex : $colIndex + 256;
7154
            $column = Coordinate::stringFromColumnIndex($colIndex + 1);
7155
        }
7156
7157
        // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
7158
        if (!(0x8000 & self::getUInt2d($cellAddressStructure, 2))) {
@@ 7328-7344 (lines=17) @@
7325
        $lrIndex = self::getUInt2d($subData, 2); // adjust below
7326
7327
        // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
7328
        if (!(0x4000 & self::getUInt2d($subData, 4))) {
7329
            // absolute column index
7330
            // offset: 4; size: 2; first column with relative/absolute flags
7331
            // bit: 7-0; mask 0x00FF; column index
7332
            $fcIndex = 0x00FF & self::getUInt2d($subData, 4);
7333
            $fc = Coordinate::stringFromColumnIndex($fcIndex + 1);
7334
            $fc = '$' . $fc;
7335
        } else {
7336
            // column offset
7337
            // offset: 4; size: 2; first column with relative/absolute flags
7338
            // bit: 7-0; mask 0x00FF; column index
7339
            $relativeFcIndex = 0x00FF & self::getInt2d($subData, 4);
7340
            $fcIndex = $baseCol + $relativeFcIndex;
7341
            $fcIndex = ($fcIndex < 256) ? $fcIndex : $fcIndex - 256;
7342
            $fcIndex = ($fcIndex >= 0) ? $fcIndex : $fcIndex + 256;
7343
            $fc = Coordinate::stringFromColumnIndex($fcIndex + 1);
7344
        }
7345
7346
        // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
7347
        if (!(0x8000 & self::getUInt2d($subData, 4))) {
@@ 7358-7374 (lines=17) @@
7355
        }
7356
7357
        // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
7358
        if (!(0x4000 & self::getUInt2d($subData, 6))) {
7359
            // absolute column index
7360
            // offset: 6; size: 2; last column with relative/absolute flags
7361
            // bit: 7-0; mask 0x00FF; column index
7362
            $lcIndex = 0x00FF & self::getUInt2d($subData, 6);
7363
            $lc = Coordinate::stringFromColumnIndex($lcIndex + 1);
7364
            $lc = '$' . $lc;
7365
        } else {
7366
            // column offset
7367
            // offset: 4; size: 2; first column with relative/absolute flags
7368
            // bit: 7-0; mask 0x00FF; column index
7369
            $relativeLcIndex = 0x00FF & self::getInt2d($subData, 4);
7370
            $lcIndex = $baseCol + $relativeLcIndex;
7371
            $lcIndex = ($lcIndex < 256) ? $lcIndex : $lcIndex - 256;
7372
            $lcIndex = ($lcIndex >= 0) ? $lcIndex : $lcIndex + 256;
7373
            $lc = Coordinate::stringFromColumnIndex($lcIndex + 1);
7374
        }
7375
7376
        // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
7377
        if (!(0x8000 & self::getUInt2d($subData, 6))) {