Showing 15,735 of 15,735 total issues
The class ElementBox has an overall complexity of 59 which is very high. The configured complexity threshold is 50. Open
class ElementBox extends Box
{
/**
* @var Element
*/
- Exclude checks
The class Page has an overall complexity of 124 which is very high. The configured complexity threshold is 50. Open
class Page extends \YetiForcePDF\Objects\Basic\DictionaryObject
{
/**
* @var int
*/
- Exclude checks
The class BoxDimensions has an overall complexity of 86 which is very high. The configured complexity threshold is 50. Open
class BoxDimensions extends Dimensions
{
/**
* @var Box
*/
- Exclude checks
The class TableBox has an overall complexity of 219 which is very high. The configured complexity threshold is 50. Open
class TableBox extends BlockBox
{
/**
* @var array minimal widths
*/
- Exclude checks
The class BlockBox has an overall complexity of 94 which is very high. The configured complexity threshold is 50. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
- Exclude checks
File LineBox.php
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* LineBox class.
Function parse
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function parse()
{
if ($this->parsed) {
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function measureOffset(bool $afterPageDividing = false)
{
if (!$this->isDisplayable()) {
return $this;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 144.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function measureOffset(bool $afterPageDividing = false)
{
if (!$this->isRenderable()) {
return $this;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 144.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method parse
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parse()
{
if ($this->parsed) {
return $this;
}
Method buildTree
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildTree($parentBlock = null)
{
if ($this->getElement()) {
$domElement = $this->getElement()->getDOMElement();
} else {
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 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 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 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 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
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 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"