Showing 284 of 325 total issues
Function writeTableStyle
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
protected function writeTableStyle(XMLWriter $objWriter, Table $shape): void
{
foreach ($shape->getRows() as $keyRow => $shapeRow) {
// style:style
$objWriter->startElement('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 writeSlideAnimations
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSlideAnimations(XMLWriter $objWriter, Slide $oSlide): void
{
$arrayAnimations = $oSlide->getAnimations();
if (empty($arrayAnimations)) {
return;
Function loadSlide
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
protected function loadSlide(string $sPart, string $baseFile): void
{
$xmlReader = new XMLReader();
// @phpstan-ignore-next-line
if ($xmlReader->getDomFromString($sPart)) {
- 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 render
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
Method writeShapeTable
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeTable(XMLWriter $objWriter, ShapeTable $shape, int $shapeId): void
{
// p:graphicFrame
$objWriter->startElement('p:graphicFrame');
// p:graphicFrame/p:nvGraphicFramePr
Function writeShapeTable
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
protected function writeShapeTable(XMLWriter $objWriter, ShapeTable $shape, int $shapeId): void
{
// p:graphicFrame
$objWriter->startElement('p:graphicFrame');
// p:graphicFrame/p:nvGraphicFramePr
- 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 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
Axis
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class Axis implements ComparableInterface
{
public const AXIS_X = 'x';
public const AXIS_Y = 'y';
Series
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class Series implements ComparableInterface
{
// Label positions
public const LABEL_BESTFIT = 'bestFit';
public const LABEL_BOTTOM = 'b';
Method writeNote
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeNote(Note $pNote): string
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
Method readStructureTextPFRun
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readStructureTextPFRun(string $stream, int $pos, int $strLenRT): array
{
$arrayReturn = [
'length' => 0,
'strLenRT' => $strLenRT,
Function loadShapeRichText
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
protected function loadShapeRichText(XMLReader $document, DOMElement $node, $oSlide): void
{
// Core
$oShape = $oSlide->createRichTextShape();
$oShape->setParagraphs([]);
- 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 writeShapeText
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeText(XMLWriter $objWriter, RichText $shape, int $shapeId): void
{
// p:sp
$objWriter->startElement('p:sp');
// p:sp\p:nvSpPr
Method loadShapeTable
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadShapeTable(XMLReader $document, DOMElement $node, AbstractSlide $oSlide): void
{
$this->fileRels = $oSlide->getRelsIndex();
$oShape = $oSlide->createTableShape();
Function loadShadow
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
protected function loadShadow(XMLReader $document, DOMElement $node): ?Shadow
{
if ($node instanceof DOMElement) {
$aNodes = $document->getElements('*', $node);
foreach ($aNodes as $nodeShadow) {
- 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
Font
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class Font implements ComparableInterface
{
// Capitalization type
public const CAPITALIZATION_NONE = 'none';
public const CAPITALIZATION_SMALL = 'small';
Function readRecordOfficeArtClientTextbox
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private function readRecordOfficeArtClientTextbox(string $stream, int $pos)
{
$arrayReturn = [
'length' => 0,
'text' => '',
- 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 readRecordOfficeArtClientTextbox
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readRecordOfficeArtClientTextbox(string $stream, int $pos)
{
$arrayReturn = [
'length' => 0,
'text' => '',
Method loadMasterSlide
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadMasterSlide(string $sPart, string $baseFile): void
{
$xmlReader = new XMLReader();
// @phpstan-ignore-next-line
if ($xmlReader->getDomFromString($sPart)) {
Method writeShapeTxt
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeTxt(XMLWriter $objWriter, RichText $shape): void
{
// draw:frame
$objWriter->startElement('draw:frame');
$objWriter->writeAttribute('draw:style-name', 'gr' . $this->shapeId);