Code Duplication    Length = 4-5 lines in 3 locations

src/PhpSpreadsheet/Chart/Renderer/JpGraph.php 3 locations

@@ 552-556 (lines=5) @@
549
550
        // Set the x-axis labels
551
        $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
552
        if ($labelCount > 0) {
553
            $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
554
            $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
555
            $this->graph->xaxis->SetTickLabels($datasetLabels);
556
        }
557
558
        $seriesPlot = new \StockPlot($dataValuesPlot);
559
        $seriesPlot->SetWidth(20);
@@ 619-622 (lines=4) @@
616
            $exploded = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
617
            if ($groupID == 0) {
618
                $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
619
                if ($labelCount > 0) {
620
                    $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
621
                    $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
622
                }
623
            }
624
625
            $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
@@ 279-283 (lines=5) @@
276
        $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
277
278
        $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
279
        if ($labelCount > 0) {
280
            $datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
281
            $datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
282
            $this->graph->xaxis->SetTickLabels($datasetLabels);
283
        }
284
285
        $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
286
        $seriesPlots = [];