Showing 325 of 325 total issues
PptCharts
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class PptCharts extends AbstractDecoratorWriter
{
public function render(): ZipInterface
{
for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
Alignment
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Alignment implements ComparableInterface
{
// Horizontal alignment
public const HORIZONTAL_GENERAL = 'l';
public const HORIZONTAL_LEFT = 'l';
File Font.php
has 268 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 writeTable
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function writeTable(): void
{
// table:table
$this->xmlContent->startElement('table:table');
$this->xmlContent->writeAttribute('table:name', 'table-local');
- 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 writeRichTextStyle
has a Cognitive Complexity of 18 (exceeds 5 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)) {
- 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 writeTable
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTable(): void
{
// table:table
$this->xmlContent->startElement('table:table');
$this->xmlContent->writeAttribute('table:name', 'table-local');
Method loadSlide
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadSlide(string $sPart, string $baseFile): void
{
$xmlReader = new XMLReader();
// @phpstan-ignore-next-line
if ($xmlReader->getDomFromString($sPart)) {
Method writeSlideLayout
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeSlideLayout(SlideLayout $pSlideLayout): string
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
// XML header
Method loadCurrentUserStream
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadCurrentUserStream(): void
{
$pos = 0;
/**
ObjectsChart
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class ObjectsChart extends AbstractDecoratorWriter
{
/**
* @var XMLWriter
*/
Method displayPhpPresentationInfo
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt): void
{
$this->append('<div class="infoBlk" id="divPhpPresentationInfo">');
$this->append('<dl>');
$this->append('<dt>Number of slides</dt><dd>' . $oPHPPpt->getSlideCount() . '</dd>');
Method render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
// Create XML writer
$objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
$objWriter->startDocument('1.0', 'UTF-8');
Function calculateExtents
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function calculateExtents(ShapeContainerInterface $container): array
{
/** @var array<string, int> $extents */
$extents = [self::X => 0, self::Y => 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 writePlotAreaStyle
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function writePlotAreaStyle(Chart $chart): void
{
$chartType = $chart->getPlotArea()->getType();
// style:style
- 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 calculateOffsets
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function calculateOffsets(ShapeContainerInterface $container): array
{
$offsets = [self::X => 0, self::Y => 0];
if (null !== $container && 0 != count($container->getShapeCollection())) {
- 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 getEndingNotes
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function getEndingNotes($writers)
{
$result = '';
// Do not show execution time for index
- 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 readRecordOfficeArtTertiaryFOPT
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function readRecordOfficeArtTertiaryFOPT(string $stream, int $pos)
{
$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
AbstractSlide
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractSlide implements ComparableInterface, ShapeContainerInterface
{
use ShapeCollection;
/**
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 render
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function render(): ZipInterface
{
/**
* @var Author[]
*/
- 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"