Showing 155 of 15,735 total issues
Function getOuterHeight
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getOuterHeight()
{
$box = $this->getBox();
if (!$box->isForMeasurement() && !$this->getBox()->getStyle()->haveSpacing()) {
return '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 spanColumns
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function spanColumns()
{
$colSpans = [];
foreach ($this->getChildren() as $column) {
if ($column->getColSpan() > 1) {
Method getNumberValues
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getNumberValues($ruleValue, bool $isFont = false)
{
if ($ruleValue instanceof NumericValue) {
return $ruleValue;
}
Method measureWidth
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
$dimensions = $this->getDimensions();
$parent = $this->getParent();
if ($parent) {
Method breakAfter
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function breakAfter(Box $box)
{
$box = $box->getFirstRootChild();
if ($box->getParent()->getLastChild() === $box) {
return $this;
Function alignText
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function alignText()
{
if ($this instanceof LineBox) {
$textAlign = $this->getParent()->getStyle()->getRules('text-align');
if ('right' === $textAlign) {
- 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 measureWidth
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function measureWidth(bool $afterPageDividing = false)
{
if ($this->parentWidth === $this->getParent()->getParent()->getDimensions()->getWidth()) {
return $this;
}
Method setUpWidths
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUpWidths(string $availableSpace)
{
foreach ($this->getChildren() as $rowGroup) {
foreach ($rowGroup->getChildren() as $row) {
if ($columns = $row->getChildren()) {
Method getInstructions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInstructions(): string
{
$style = $this->getStyle();
$rules = $style->getRules();
$graphicState = $this->style->getGraphicState();
Method setUpAbsoluteBoxes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUpAbsoluteBoxes()
{
$this->document->setCurrentPage($this);
$this->getBox()->getOffset()->setLeft('0');
$this->getBox()->getOffset()->setTop('0');
Method addToOthers
has 38 lines of code (exceeds 25 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) {
Method expandPercentsToMin
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function expandPercentsToMin(string $availableSpace)
{
$totalPercentageSpecified = $this->getTotalPercentage();
$maxPercentRatio = '0';
$maxPercentRatioIndex = 0;
Method appendText
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function appendText($childDomElement, $element = null, $style = null, $parentBlock = null)
{
$text = $childDomElement->textContent;
$whiteSpace = $this->getStyle()->getRules('white-space');
switch ($whiteSpace) {
Function removeEmptyRows
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function removeEmptyRows()
{
foreach ($this->getChildren() as $rowGroup) {
if (!$rowGroup->containContent() || !$rowGroup->hasChildren()) {
$this->removeChild($rowGroup);
- 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 addPage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function addPage(string $format = '', string $orientation = '', Page $page = null, Page $after = null): Page
{
if (null === $page) {
$page = (new Page())->setDocument($this)->init();
}
- 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 getBoxesByTagName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getBoxesByTagName(string $tagName)
{
$boxes = [];
$allChildren = [];
$this->getAllChildren($allChildren);
- 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 getChildren
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getChildren(bool $onlyRenderable = false, bool $onlyForMeasurment = false): array
{
if (!$onlyRenderable && !$onlyForMeasurment) {
return $this->children;
}
- 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 addObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function addObject(PdfObject $object, $after = null): self
{
$afterIndex = \count($this->objects);
if ($after) {
foreach ($this->objects as $afterIndex => $obj) {
- 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 measureOffset
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function measureOffset(bool $afterPageDividing = false)
{
if (\YetiForcePDF\Page::CUT_BELOW === $this->wasCut()) {
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
Function cloneAndDivideChildrenAfterY
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function cloneAndDivideChildrenAfterY(string $yPos, array $boxes = null)
{
if (null === $boxes) {
$boxes = [];
foreach ($this->getBox()->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"