Showing 284 of 325 total issues
File PowerPoint97.php
has 2279 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 writeSlideRelationships
has a Cognitive Complexity of 270 (exceeds 5 allowed). Consider refactoring. Open
protected function writeSlideRelationships(Slide $pSlide): string
{
//@todo Group all getShapeCollection()->getIterator
// Create XML writer
- 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 readRecordOfficeArtSpContainer
has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring. Open
private function readRecordOfficeArtSpContainer(string $stream, int $pos)
{
$arrayReturn = [
'length' => 0,
'shape' => null,
- 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
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.
*
File AbstractSlide.php
has 1261 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.
*
File PowerPoint2007.php
has 1202 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 loadParagraph
has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring. Open
protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oShape): void
{
// Core
$oParagraph = $oShape->createParagraph();
$oParagraph->setRichTextElements([]);
- 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
File Content.php
has 1078 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 loadStyle
has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring. Open
protected function loadStyle(DOMElement $nodeStyle): bool
{
$keyStyle = $nodeStyle->getAttribute('style:name');
$nodeDrawingPageProps = $this->oXMLReader->getElement('style:drawing-page-properties', $nodeStyle);
- 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 loadShapeTable
has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring. Open
protected function loadShapeTable(XMLReader $document, DOMElement $node, AbstractSlide $oSlide): void
{
$this->fileRels = $oSlide->getRelsIndex();
$oShape = $oSlide->createTableShape();
- 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 writeTheme
has 422 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTheme(Slide\SlideMaster $oMasterSlide): string
{
$arrayFont = [
'Jpan' => 'MS Pゴシック',
'Hang' => '맑은 고딕',
Function loadMasterSlide
has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring. Open
protected function loadMasterSlide(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
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 readRecordDocumentContainer
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
private function readRecordDocumentContainer(string $stream, int $pos): void
{
$documentAtom = $this->loadRecordHeader($stream, $pos);
$pos += 8;
if (0x1 != $documentAtom['recVer'] || 0x000 != $documentAtom['recInstance'] || self::RT_DOCUMENTATOM != $documentAtom['recType']) {
- 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 readRecordOfficeArtFOPT
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
private function readRecordOfficeArtFOPT(string $stream, int $pos): array
{
$arrayReturn = [
'length' => 0,
];
- 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 writeContent
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
protected function writeContent(): string
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
$objWriter->startDocument('1.0', 'UTF-8');
- 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
File ODPresentation.php
has 596 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 writeShapeTxt
has a Cognitive Complexity of 65 (exceeds 5 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);
- 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
File Sample_05_Chart.php
has 583 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
include_once 'Sample_Header.php';
use PhpOffice\PhpPresentation\PhpPresentation;
Method writeContent
has 246 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeContent(): string
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
$objWriter->startDocument('1.0', 'UTF-8');