File PptCharts.php
has 1413 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of PHPPresentation - A pure PHP library for reading and writing
* presentations documents.
*
Method writeAxis
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeAxis(XMLWriter $objWriter, Chart\Axis $oAxis, string $typeAxis, Chart\Type\AbstractType $typeChart): void
{
if (Chart\Axis::AXIS_X != $typeAxis && Chart\Axis::AXIS_Y != $typeAxis) {
return;
}
Method writeTypeBar
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeBar(XMLWriter $objWriter, Bar $subject, bool $includeSheet = false): void
{
// c:barChart
$objWriter->startElement('c:barChart');
Method writeTypeBar3D
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeBar3D(XMLWriter $objWriter, Bar3D $subject, bool $includeSheet = false): void
{
// c:bar3DChart
$objWriter->startElement('c:bar3DChart');
Method writeTypeDoughnut
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeDoughnut(XMLWriter $objWriter, Doughnut $subject, bool $includeSheet = false): void
{
// c:pieChart
$objWriter->startElement('c:doughnutChart');
Method writeTypeScatter
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeScatter(XMLWriter $objWriter, Scatter $subject, bool $includeSheet = false): void
{
// c:scatterChart
$objWriter->startElement('c:scatterChart');
Method writeTypePie
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypePie(XMLWriter $objWriter, Pie $subject, bool $includeSheet = false): void
{
// c:pieChart
$objWriter->startElement('c:pieChart');
Method writeTypeLine
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeLine(XMLWriter $objWriter, Line $subject, bool $includeSheet = false): void
{
// c:lineChart
$objWriter->startElement('c:lineChart');
Method writeTypeRadar
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeRadar(XMLWriter $objWriter, Radar $subject, bool $includeSheet = false): void
{
// c:scatterChart
$objWriter->startElement('c:radarChart');
Method writeTypePie3D
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypePie3D(XMLWriter $objWriter, Pie3D $subject, bool $includeSheet = false): void
{
// c:pie3DChart
$objWriter->startElement('c:pie3DChart');
Function writeAxis
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function writeAxis(XMLWriter $objWriter, Chart\Axis $oAxis, string $typeAxis, Chart\Type\AbstractType $typeChart): void
{
if (Chart\Axis::AXIS_X != $typeAxis && Chart\Axis::AXIS_Y != $typeAxis) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method writeChart
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeChart(Chart $chart): string
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
PptCharts
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class PptCharts extends AbstractDecoratorWriter
{
public function render(): ZipInterface
{
for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
Method writeLegend
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeLegend(XMLWriter $objWriter, Legend $subject): void
{
// c:legend
$objWriter->startElement('c:legend');
Method writeTypeArea
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeArea(XMLWriter $objWriter, Area $subject, bool $includeSheet = false): void
{
// c:lineChart
$objWriter->startElement('c:areaChart');
Method writeTitle
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTitle(XMLWriter $objWriter, Title $subject): void
{
// c:title
$objWriter->startElement('c:title');
Method writeSpreadsheet
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSpreadsheet(PhpPresentation $presentation, Chart $chart, string $tempName): string
{
// Create new spreadsheet
$spreadsheet = new Spreadsheet();
Function writePlotArea
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function writePlotArea(XMLWriter $objWriter, PlotArea $subject, Chart $chart): void
{
// c:plotArea
$objWriter->startElement('c:plotArea');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method writeMultipleValuesOrReference
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeMultipleValuesOrReference(XMLWriter $objWriter, bool $isReference, array $values, string $reference): void
{
// c:strLit / c:numLit
// c:strRef / c:numRef
$referenceType = ($isReference ? 'Ref' : 'Lit');
Method writePlotArea
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writePlotArea(XMLWriter $objWriter, PlotArea $subject, Chart $chart): void
{
// c:plotArea
$objWriter->startElement('c:plotArea');
Method writeLayout
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeLayout(XMLWriter $objWriter, $subject): void
{
// c:layout
$objWriter->startElement('c:layout');
Function writeTypeBar
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function writeTypeBar(XMLWriter $objWriter, Bar $subject, bool $includeSheet = false): void
{
// c:barChart
$objWriter->startElement('c:barChart');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function writeTypeDoughnut
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function writeTypeDoughnut(XMLWriter $objWriter, Doughnut $subject, bool $includeSheet = false): void
{
// c:pieChart
$objWriter->startElement('c:doughnutChart');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
$shape = $this->getDrawingHashTable()->getByIndex($i);
if ($shape instanceof Chart) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function writeTypeBar3D
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function writeTypeBar3D(XMLWriter $objWriter, Bar3D $subject, bool $includeSheet = false): void
{
// c:bar3DChart
$objWriter->startElement('c:bar3DChart');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function writeSpreadsheet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function writeSpreadsheet(PhpPresentation $presentation, Chart $chart, string $tempName): string
{
// Create new spreadsheet
$spreadsheet = new Spreadsheet();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function writeMultipleValuesOrReference
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function writeMultipleValuesOrReference(XMLWriter $objWriter, bool $isReference, array $values, string $reference): void
{
// c:strLit / c:numLit
// c:strRef / c:numRef
$referenceType = ($isReference ? 'Ref' : 'Lit');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"