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.
*
Method writeSlideTransition
has 235 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSlideTransition(XMLWriter $objWriter, ?Slide\Transition $transition): void
{
if (!$transition) {
return;
}
Function writeSlideTransition
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
protected function writeSlideTransition(XMLWriter $objWriter, ?Slide\Transition $transition): void
{
if (!$transition) {
return;
}
- 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 writeShapeText
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
protected function writeShapeText(XMLWriter $objWriter, RichText $shape, int $shapeId): void
{
// p:sp
$objWriter->startElement('p:sp');
// p:sp\p:nvSpPr
- 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 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
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 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 writeShapePic
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapePic(XMLWriter $objWriter, AbstractGraphic $shape, int $shapeId): void
{
// p:pic
$objWriter->startElement('p:pic');
Function writeDrawingRelations
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function writeDrawingRelations(AbstractSlideAlias $pSlideMaster, XMLWriter $objWriter, int $relId)
{
if (count($pSlideMaster->getShapeCollection()) > 0) {
// Loop trough images and write relationships
foreach ($pSlideMaster->getShapeCollection() as $shape) {
- 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 writeShapeLine
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeLine(XMLWriter $objWriter, Line $shape, int $shapeId): void
{
// p:sp
$objWriter->startElement('p:cxnSp');
// p:nvSpPr
Method writeParagraphStyles
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeParagraphStyles(XMLWriter $objWriter, Paragraph $paragraph, bool $isPlaceholder = false): void
{
$objWriter->startElement('a:pPr');
$objWriter->writeAttribute('algn', $paragraph->getAlignment()->getHorizontal());
$objWriter->writeAttribute('rtl', $paragraph->getAlignment()->isRTL() ? '1' : '0');
Function writeParagraphStyles
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function writeParagraphStyles(XMLWriter $objWriter, Paragraph $paragraph, bool $isPlaceholder = false): void
{
$objWriter->startElement('a:pPr');
$objWriter->writeAttribute('algn', $paragraph->getAlignment()->getHorizontal());
$objWriter->writeAttribute('rtl', $paragraph->getAlignment()->isRTL() ? '1' : '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 writeDrawingRelations
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeDrawingRelations(AbstractSlideAlias $pSlideMaster, XMLWriter $objWriter, int $relId)
{
if (count($pSlideMaster->getShapeCollection()) > 0) {
// Loop trough images and write relationships
foreach ($pSlideMaster->getShapeCollection() as $shape) {
Method writeShapeAutoShape
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeAutoShape(XMLWriter $objWriter, AutoShape $shape, int $shapeId): void
{
// p:sp
$objWriter->startElement('p:sp');
Method writeShapeChart
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeChart(XMLWriter $objWriter, ShapeChart $shape, int $shapeId): void
{
// p:graphicFrame
$objWriter->startElement('p:graphicFrame');
// p:nvGraphicFramePr
Method writeSlideBackground
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSlideBackground(AbstractSlideAlias $pSlide, XMLWriter $objWriter): void
{
if (!($pSlide->getBackground() instanceof Slide\AbstractBackground)) {
return;
}
Function writeShapeCollection
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function writeShapeCollection(XMLWriter $objWriter, $shapes = [], &$shapeId = 1): void
{
if (0 == count($shapes)) {
return;
}
- 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 writeParagraphs
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function writeParagraphs(XMLWriter $objWriter, array $paragraphs): void
{
// Loop trough paragraphs
foreach ($paragraphs as $paragraph) {
// a:p
- 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 writeRunStyles
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeRunStyles(XMLWriter $objWriter, Run $element): void
{
// a:rPr
$objWriter->startElement('a:rPr');
Method writeShapeGroup
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeGroup(XMLWriter $objWriter, Group $group, int &$shapeId): void
{
// p:grpSp
$objWriter->startElement('p:grpSp');
// p:nvGrpSpPr
Function writeShapePic
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function writeShapePic(XMLWriter $objWriter, AbstractGraphic $shape, int $shapeId): void
{
// p:pic
$objWriter->startElement('p:pic');
- 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 writeShapeLine
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function writeShapeLine(XMLWriter $objWriter, Line $shape, int $shapeId): void
{
// p:sp
$objWriter->startElement('p:cxnSp');
// p:nvSpPr
- 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"