Showing 284 of 325 total issues
Function writeShapeGroup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function writeShapeGroup(XMLWriter $objWriter, Group $group): void
{
// draw:g
$objWriter->startElement('draw:g');
- 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
Avoid deeply nested control flow statements. Open
if ($element->hasHyperlink()) {
// Write relationship for hyperlink
$hyperlink = $element->getHyperlink();
$hyperlink->relationId = 'rId' . $relId;
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
Avoid deeply nested control flow statements. Open
if ($element instanceof Run || $element instanceof TextElement) {
if ($element->hasHyperlink()) {
// Write relationship for hyperlink
$hyperlink = $element->getHyperlink();
$hyperlink->relationId = 'rId' . $relId;
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
foreach ($this->oPresentation->getAllSlides() as $idx => $oSlide) {
$this->oZip->addFromString('ppt/slides/_rels/slide' . ($idx + 1) . '.xml.rels', $this->writeSlideRelationships($oSlide));
$this->oZip->addFromString('ppt/slides/slide' . ($idx + 1) . '.xml', $this->writeSlide($oSlide));
- 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
Avoid deeply nested control flow statements. Open
if (isset($clientTextbox['text' . $inc]['bulletChar'])) {
$arrayReturn['shape']->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET);
$arrayReturn['shape']->getActiveParagraph()->getBulletStyle()->setBulletChar($clientTextbox['text' . $inc]['bulletChar']);
}
Avoid deeply nested control flow statements. Open
if (isset($clientTextbox['text' . $inc]['leftMargin'])) {
if ($lastMarginLeft > $clientTextbox['text' . $inc]['leftMargin']) {
--$lastLevel;
}
if ($lastMarginLeft < $clientTextbox['text' . $inc]['leftMargin']) {
Avoid deeply nested control flow statements. Open
if (!empty($clientTextbox['hyperlink'])) {
foreach ($clientTextbox['hyperlink'] as $itmHyperlink) {
if ($itmHyperlink['start'] == $start && ($itmHyperlink['end'] - $itmHyperlink['start']) == (float) $clientTextbox['part' . $inc]['partLength']) {
$sText = $this->arrayHyperlinks[$itmHyperlink['id']]['text'];
$sHyperlinkURL = $this->arrayHyperlinks[$itmHyperlink['id']]['url'];
Avoid deeply nested control flow statements. Open
if ($this->currentNote > 0 && isset($arrayIdxSlide[$this->currentNote])) {
$oSlide = $this->oPhpPresentation->getSlide($arrayIdxSlide[$this->currentNote]);
if (0 == count($oSlide->getNote()->getShapeCollection())) {
$oSlide->getNote()->addShape($fileBlock['shape']);
}
Avoid deeply nested control flow statements. Open
if (isset($clientTextbox['text' . $inc]['indent'])) {
$indent = $clientTextbox['text' . $inc]['indent'];
}
Function readRecordOfficeArtClientData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function readRecordOfficeArtClientData(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
Avoid deeply nested control flow statements. Open
if ($shadowOffsetX > 0 && $shadowOffsetX == $shadowOffsetY) {
$arrayReturn['shape']->getShadow()->setDistance($shadowOffsetX)->setDirection(45);
}
Avoid deeply nested control flow statements. Open
if ('..' == $partPath) {
unset($pathImage[$key - 1], $pathImage[$key]);
}
Avoid deeply nested control flow statements. Open
if (!$image) {
return;
}
Function loadPicturesStream
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function loadPicturesStream(): void
{
$stream = $this->streamPictures;
$pos = 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
Method writeRelationship
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function writeRelationship(XMLWriter $objWriter, int $pId, string $pType, string $pTarget, string $pTargetMode = ''): void
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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
$arrMedia = [];
for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
$shape = $this->getDrawingHashTable()->getByIndex($i);
- 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 absoluteZipPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function absoluteZipPath(string $path): string
{
$path = str_replace([
'/',
'\\',
- 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 loadViewProperties
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function loadViewProperties(string $sPart): 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"