File ObjectsChart.php
has 721 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.
*
Function writeSeriesStyle
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
protected function writeSeriesStyle(Chart $chart, Chart\Series $series): void
{
$chartType = $chart->getPlotArea()->getType();
// style:style
- 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 writeSeriesStyle
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSeriesStyle(Chart $chart, Chart\Series $series): void
{
$chartType = $chart->getPlotArea()->getType();
// style:style
Method writeContentPart
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeContentPart(Chart $chart): string
{
$this->xmlContent = new XMLWriter(XMLWriter::STORAGE_MEMORY);
$chartType = $chart->getPlotArea()->getType();
Function writeTable
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function writeTable(): void
{
// table:table
$this->xmlContent->startElement('table:table');
$this->xmlContent->writeAttribute('table:name', 'table-local');
- 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 writeTable
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTable(): void
{
// table:table
$this->xmlContent->startElement('table:table');
$this->xmlContent->writeAttribute('table:name', 'table-local');
ObjectsChart
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class ObjectsChart extends AbstractDecoratorWriter
{
/**
* @var XMLWriter
*/
Function writePlotAreaStyle
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function writePlotAreaStyle(Chart $chart): void
{
$chartType = $chart->getPlotArea()->getType();
// style:style
- 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 writePlotAreaStyle
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writePlotAreaStyle(Chart $chart): void
{
$chartType = $chart->getPlotArea()->getType();
// style:style
Method writeSeries
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSeries(Chart $chart, Chart\Series $series): void
{
$chartType = $chart->getPlotArea()->getType();
$numRange = count($series->getValues());
Method writeAxisMainStyle
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeAxisMainStyle(Axis $axis, string $styleName, AbstractType $chartType): void
{
// style:style
$this->xmlContent->startElement('style:style');
$this->xmlContent->writeAttribute('style:name', $styleName);
Function writeContentPart
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function writeContentPart(Chart $chart): string
{
$this->xmlContent = new XMLWriter(XMLWriter::STORAGE_MEMORY);
$chartType = $chart->getPlotArea()->getType();
- 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 writePlotArea
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writePlotArea(Chart $chart): void
{
$chartType = $chart->getPlotArea()->getType();
// chart:plot-area
Method writeAxis
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeAxis(Chart $chart): void
{
$chartType = $chart->getPlotArea()->getType();
// chart:axis
Function writeSeries
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function writeSeries(Chart $chart, Chart\Series $series): void
{
$chartType = $chart->getPlotArea()->getType();
$numRange = count($series->getValues());
- 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 writeLegend
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function writeLegend(Chart $chart): void
{
// chart:legend
$this->xmlContent->startElement('chart:legend');
switch ($chart->getLegend()->getPosition()) {
- 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 writePlotArea
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function writePlotArea(Chart $chart): void
{
$chartType = $chart->getPlotArea()->getType();
// chart:plot-area
- 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"