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
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.
*
Method loadStyle
has 230 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadStyle(DOMElement $nodeStyle): bool
{
$keyStyle = $nodeStyle->getAttribute('style:name');
$nodeDrawingPageProps = $this->oXMLReader->getElement('style:drawing-page-properties', $nodeStyle);
Function readParagraph
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function readParagraph(RichText $oShape, DOMElement $oNodeParent): void
{
$oParagraph = $oShape->createParagraph();
if ($oNodeParent->hasAttribute('text:style-name')) {
$keyStyle = $oNodeParent->getAttribute('text:style-name');
- 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 loadDocumentProperties
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function loadDocumentProperties(): void
{
$arrayProperties = [
'/office:document-meta/office:meta/meta:initial-creator' => 'setCreator',
'/office:document-meta/office:meta/dc:creator' => 'setLastModifiedBy',
- 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 loadDocumentProperties
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadDocumentProperties(): void
{
$arrayProperties = [
'/office:document-meta/office:meta/meta:initial-creator' => 'setCreator',
'/office:document-meta/office:meta/dc:creator' => 'setLastModifiedBy',
Function loadSlide
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function loadSlide(DOMElement $nodeSlide): bool
{
// Core
$this->oPhpPresentation->createSlide();
$this->oPhpPresentation->setActiveSlideIndex($this->oPhpPresentation->getSlideCount() - 1);
- 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 loadShapeDrawing
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function loadShapeDrawing(DOMElement $oNodeFrame): void
{
// Core
$mimetype = '';
- 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 loadShapeDrawing
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadShapeDrawing(DOMElement $oNodeFrame): void
{
// Core
$mimetype = '';
Function readParagraphItem
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function readParagraphItem(Paragraph $oParagraph, DOMElement $oNodeParent): void
{
if ($this->oXMLReader->elementExists('text:line-break', $oNodeParent)) {
$oParagraph->createBreak();
} else {
- 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 readParagraph
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function readParagraph(RichText $oShape, DOMElement $oNodeParent): void
{
$oParagraph = $oShape->createParagraph();
if ($oNodeParent->hasAttribute('text:style-name')) {
$keyStyle = $oNodeParent->getAttribute('text:style-name');
Function loadShapeRichText
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function loadShapeRichText(DOMElement $oNodeFrame): void
{
// Core
$oShape = $this->oPhpPresentation->getActiveSlide()->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
Function readList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function readList(RichText $oShape, DOMElement $oNodeParent): void
{
foreach ($this->oXMLReader->getElements('text:list-item/*', $oNodeParent) as $oNodeListItem) {
if ($oNodeListItem instanceof DOMElement) {
if ('text:p' == $oNodeListItem->nodeName) {
- 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 readListItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function readListItem(RichText $oShape, DOMElement $oNodeParent, DOMElement $oNodeParagraph): void
{
$oParagraph = $oShape->createParagraph();
if ($oNodeParagraph->hasAttribute('text:style-name')) {
$keyStyle = $oNodeParagraph->getAttribute('text:style-name');
- 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 loadSlides
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function loadSlides(): void
{
foreach ($this->oXMLReader->getElements('/office:document-content/office:automatic-styles/*') as $oElement) {
if ($oElement instanceof DOMElement && $oElement->hasAttribute('style:name')) {
$this->loadStyle($oElement);
- 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"