Showing 287 of 15,735 total issues
File Style.php
has 1259 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* Style class.
File TableBox.php
has 979 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* TableBox class.
File Page.php
has 934 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* Page class.
Function fixTables
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
public function fixTables()
{
$box = $this->getBox();
if ($box->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 fixTables
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
public function fixTables()
{
$tables = $this->getBoxesByType('TableWrapperBox');
foreach ($tables as $tableWrapperBox) {
$tableBox = $tableWrapperBox->getFirstChild();
- 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 measureHeight
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
public function measureHeight(bool $afterPageDividing = false)
{
if ($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
File Box.php
has 679 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* Box class.
Box
has 62 functions (exceeds 20 allowed). Consider refactoring. Open
class Box extends \YetiForcePDF\Base
{
/**
* Id of this box (should be cloned to track inline wrapped elements).
*
Function divideTable
has a Cognitive Complexity of 56 (exceeds 5 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);
- 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
Style
has 60 functions (exceeds 20 allowed). Consider refactoring. Open
class Style extends \YetiForcePDF\Base
{
/**
* @var \YetiForcePDF\Document
*/
File BlockBox.php
has 517 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* BlockBox class.
File Document.php
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* Document class.
Document
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class Document
{
/**
* Actual id auto incremented.
*
File Font.php
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* Font class.
Function buildTree
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public function buildTree($parentBlock = null)
{
if ($this->getElement()) {
$domElement = $this->getElement()->getDOMElement();
} else {
- 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 divide
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public function divide()
{
$lines = [];
$line = (new self())
->setDocument($this->document)
- 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
Page
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class Page extends \YetiForcePDF\Objects\Basic\DictionaryObject
{
/**
* @var int
*/
TableBox
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
class TableBox extends BlockBox
{
/**
* @var array minimal widths
*/
Method measureHeight
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function measureHeight(bool $afterPageDividing = false)
{
if ($this->wasCut()) {
return $this;
}
Function spanRows
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function spanRows()
{
$toRemove = [];
foreach ($this->getChildren() as $rowGroup) {
foreach ($rowGroup->getChildren() as $rowIndex => $row) {
- 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"