Showing 155 of 15,735 total issues
Method divideTable
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function divideTable(Box $tableChild, string $yPos, Box $cloned)
{
$tableWrapperBox = $tableChild->getClosestByType('TableWrapperBox');
if ($this->treatTableLikeDiv($tableWrapperBox, $yPos)) {
return $this->cutBox($tableWrapperBox, $yPos, $cloned);
File InlineBox.php
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* InlineBox class.
Function addToOthers
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function addToOthers(string $leftSpace, bool $withPreferred = false)
{
// first of all try to redistribute space to columns that need it most (width is under preferred)
// left space is the space that we can add to other column types that needs extra space to preferred width
if ($withPreferred) {
- 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 clearStyles
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function clearStyles()
{
$allNestedChildren = [];
$maxLevel = '0';
foreach ($this->getChildren() as $child) {
- 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 measureWidth
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
$dimensions = $this->getDimensions();
$parent = $this->getParent();
if ($parent) {
- 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 parse
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse()
{
if ('' === $this->html) {
return null;
}
Function matchFont
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function matchFont(bool $custom = false)
{
if (!$custom) {
return static::$fontFiles[$this->family][$this->weight][$this->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 setUpSizingTypes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function setUpSizingTypes()
{
$columnSizingTypes = [];
// rowGroup -> row -> columns
$columns = $this->getFirstChild()->getFirstChild()->getChildren();
- 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 addToPreferredOthers
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function addToPreferredOthers(string $leftSpace)
{
$autoNeededTotal = '0';
$pixelNeededTotal = '0';
$autoNeeded = [];
- 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 parse
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function parse()
{
if ('' === $this->html) {
return null;
}
- 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 divide
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function divide()
{
$lines = [];
$line = (new self())
->setDocument($this->document)
Function tryPreferred
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function tryPreferred(string $leftSpace, bool $outerWidthSet)
{
// left space is 100% width that we can use
$totalPercentages = '0';
$totalPercentagesWidth = '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 breakAfter
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function breakAfter(Box $box)
{
$box = $box->getFirstRootChild();
if ($box->getParent()->getLastChild() === $box) {
return $this;
- 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 addToPreferredOthers
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addToPreferredOthers(string $leftSpace)
{
$autoNeededTotal = '0';
$pixelNeededTotal = '0';
$autoNeeded = [];
Method spanRows
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function spanRows()
{
$toRemove = [];
foreach ($this->getChildren() as $rowGroup) {
foreach ($rowGroup->getChildren() as $rowIndex => $row) {
Method appendTableCellBox
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function appendTableCellBox($childDomElement, $element, $style, $parentBlock)
{
$colSpan = 1;
$style->setRule('display', 'block');
$attributeColSpan = $childDomElement->getAttribute('colspan');
Method setGroupOptions
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
{
$childDomElement = $domDocument->documentElement->firstChild;
if (!$childDomElement instanceof \DOMElement) {
return $this;
Method tryPreferred
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function tryPreferred(string $leftSpace, bool $outerWidthSet)
{
// left space is 100% width that we can use
$totalPercentages = '0';
$totalPercentagesWidth = '0';
Method applyPercentage
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function applyPercentage(string $availableSpace)
{
$currentRowsWidth = '0';
if ('auto' === $this->getParent()->getStyle()->getRules('width')) {
foreach ($this->getRows()[0]->getChildren() as $columnIndex => $column) {
Function cutBox
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function cutBox(Box $box, string $yPos, Box $cloned)
{
foreach ($box->getChildren() as $child) {
if (!$child->isForMeasurement() || !$child->isRenderable()) {
continue;
- 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"