Showing 284 of 325 total issues
Method writeTxtStyle
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTxtStyle(XMLWriter $objWriter, RichText $shape): void
{
// style:style
$objWriter->startElement('style:style');
$objWriter->writeAttribute('style:name', 'gr' . $this->shapeId);
Function loadCustomProperties
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function loadCustomProperties(string $sPart): void
{
$xmlReader = new XMLReader();
$sPart = str_replace(' xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"', '', $sPart);
// @phpstan-ignore-next-line
- 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 writeTableStyle
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTableStyle(XMLWriter $objWriter, Table $shape): void
{
foreach ($shape->getRows() as $keyRow => $shapeRow) {
// style:style
$objWriter->startElement('style:style');
Method writeTypePie
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypePie(XMLWriter $objWriter, Pie $subject, bool $includeSheet = false): void
{
// c:pieChart
$objWriter->startElement('c:pieChart');
Method writeTypeLine
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeLine(XMLWriter $objWriter, Line $subject, bool $includeSheet = false): void
{
// c:lineChart
$objWriter->startElement('c:lineChart');
Method loadShapeDrawing
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadShapeDrawing(XMLReader $document, DOMElement $node, AbstractSlide $oSlide): void
{
// Core
$document->registerNamespace('asvg', 'http://schemas.microsoft.com/office/drawing/2016/SVG/main');
if ($document->getElement('p:blipFill/a:blip/a:extLst/a:ext/asvg:svgBlip', $node)) {
Method writeTypeRadar
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypeRadar(XMLWriter $objWriter, Radar $subject, bool $includeSheet = false): void
{
// c:scatterChart
$objWriter->startElement('c:radarChart');
Paragraph
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Paragraph implements ComparableInterface
{
public const LINE_SPACING_MODE_PERCENT = 'percent';
public const LINE_SPACING_MODE_POINT = 'point';
Cell
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Cell implements ComparableInterface
{
/**
* Rich text paragraphs.
*
Method writeTypePie3D
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeTypePie3D(XMLWriter $objWriter, Pie3D $subject, bool $includeSheet = false): void
{
// c:pie3DChart
$objWriter->startElement('c:pie3DChart');
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);