Code Duplication    Length = 16-17 lines in 3 locations

src/PhpSpreadsheet/Reader/Xls.php 3 locations

@@ 7150-7165 (lines=16) @@
7147
        $row = self::getUInt2d($cellAddressStructure, 0) + 1;
7148
7149
        // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
7150
        if (!(0x4000 & self::getUInt2d($cellAddressStructure, 2))) {
7151
            // offset: 2; size: 2; index to column or column offset + relative flags
7152
            // bit: 7-0; mask 0x00FF; column index
7153
            $colIndex = 0x00FF & self::getUInt2d($cellAddressStructure, 2);
7154
7155
            $column = Coordinate::stringFromColumnIndex($colIndex + 1);
7156
            $column = '$' . $column;
7157
        } else {
7158
            // offset: 2; size: 2; index to column or column offset + relative flags
7159
            // bit: 7-0; mask 0x00FF; column index
7160
            $relativeColIndex = 0x00FF & self::getInt2d($cellAddressStructure, 2);
7161
            $colIndex = $baseCol + $relativeColIndex;
7162
            $colIndex = ($colIndex < 256) ? $colIndex : $colIndex - 256;
7163
            $colIndex = ($colIndex >= 0) ? $colIndex : $colIndex + 256;
7164
            $column = Coordinate::stringFromColumnIndex($colIndex + 1);
7165
        }
7166
7167
        // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
7168
        if (!(0x8000 & self::getUInt2d($cellAddressStructure, 2))) {
@@ 7338-7354 (lines=17) @@
7335
        $lrIndex = self::getUInt2d($subData, 2); // adjust below
7336
7337
        // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
7338
        if (!(0x4000 & self::getUInt2d($subData, 4))) {
7339
            // absolute column index
7340
            // offset: 4; size: 2; first column with relative/absolute flags
7341
            // bit: 7-0; mask 0x00FF; column index
7342
            $fcIndex = 0x00FF & self::getUInt2d($subData, 4);
7343
            $fc = Coordinate::stringFromColumnIndex($fcIndex + 1);
7344
            $fc = '$' . $fc;
7345
        } else {
7346
            // column offset
7347
            // offset: 4; size: 2; first column with relative/absolute flags
7348
            // bit: 7-0; mask 0x00FF; column index
7349
            $relativeFcIndex = 0x00FF & self::getInt2d($subData, 4);
7350
            $fcIndex = $baseCol + $relativeFcIndex;
7351
            $fcIndex = ($fcIndex < 256) ? $fcIndex : $fcIndex - 256;
7352
            $fcIndex = ($fcIndex >= 0) ? $fcIndex : $fcIndex + 256;
7353
            $fc = Coordinate::stringFromColumnIndex($fcIndex + 1);
7354
        }
7355
7356
        // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
7357
        if (!(0x8000 & self::getUInt2d($subData, 4))) {
@@ 7368-7384 (lines=17) @@
7365
        }
7366
7367
        // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
7368
        if (!(0x4000 & self::getUInt2d($subData, 6))) {
7369
            // absolute column index
7370
            // offset: 6; size: 2; last column with relative/absolute flags
7371
            // bit: 7-0; mask 0x00FF; column index
7372
            $lcIndex = 0x00FF & self::getUInt2d($subData, 6);
7373
            $lc = Coordinate::stringFromColumnIndex($lcIndex + 1);
7374
            $lc = '$' . $lc;
7375
        } else {
7376
            // column offset
7377
            // offset: 4; size: 2; first column with relative/absolute flags
7378
            // bit: 7-0; mask 0x00FF; column index
7379
            $relativeLcIndex = 0x00FF & self::getInt2d($subData, 4);
7380
            $lcIndex = $baseCol + $relativeLcIndex;
7381
            $lcIndex = ($lcIndex < 256) ? $lcIndex : $lcIndex - 256;
7382
            $lcIndex = ($lcIndex >= 0) ? $lcIndex : $lcIndex + 256;
7383
            $lc = Coordinate::stringFromColumnIndex($lcIndex + 1);
7384
        }
7385
7386
        // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
7387
        if (!(0x8000 & self::getUInt2d($subData, 6))) {