Showing 325 of 325 total issues
Method writeRichTextStyle
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeRichTextStyle(XMLWriter $objWriter, RichText $shape): void
{
$oFill = $shape->getFill();
if (Fill::FILL_GRADIENT_LINEAR == $oFill->getFillType() || Fill::FILL_GRADIENT_PATH == $oFill->getFillType()) {
if (!in_array($oFill->getHashCode(), $this->arrayGradient)) {
Function writeAxis
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function writeAxis(XMLWriter $objWriter, Chart\Axis $oAxis, string $typeAxis, Chart\Type\AbstractType $typeChart): void
{
if (Chart\Axis::AXIS_X != $typeAxis && Chart\Axis::AXIS_Y != $typeAxis) {
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
Method writeChart
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeChart(Chart $chart): string
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
Method loadShapeRichText
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadShapeRichText(XMLReader $document, DOMElement $node, $oSlide): void
{
// Core
$oShape = $oSlide->createRichTextShape();
$oShape->setParagraphs([]);
Method render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
Function render
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
- 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 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
Method readStructureTextRuler
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readStructureTextRuler(string $stream, int $pos): array
{
$arrayReturn = [
'length' => 0,
];
Method writeSlide
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSlide(Slide $pSlide): string
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
Method render
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
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
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
Function loadCurrentUserStream
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function loadCurrentUserStream(): void
{
$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 fnSlide_BarPercentStacked
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fnSlide_BarPercentStacked(PhpPresentation $objPHPPresentation): void
{
global $oFill;
global $oShadow;
Legend
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Legend implements ComparableInterface
{
/** Legend positions */
public const POSITION_BOTTOM = 'b';
public const POSITION_LEFT = 'l';
PhpPresentation
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class PhpPresentation
{
/**
* Document properties.
*
Function save
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function save(string $pFilename): void
{
if (empty($pFilename)) {
throw new InvalidParameterException('pFilename', '');
}
- 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 save
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function save(string $pFilename): void
{
if (empty($pFilename)) {
throw new InvalidParameterException('pFilename', '');
}
- 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 writeShapeTable
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeShapeTable(XMLWriter $objWriter, Table $shape): void
{
// draw:frame
$objWriter->startElement('draw:frame');
$objWriter->writeAttribute('svg:x', Text::numberFormat(CommonDrawing::pixelsToCentimeters((int) $shape->getOffsetX()), 3) . 'cm');