Showing 287 of 15,735 total issues
The class LineBox has an overall complexity of 67 which is very high. The configured complexity threshold is 50. Open
class LineBox extends Box implements BoxInterface
{
/**
* Append block box element.
*
- Exclude checks
The class BlockBox has 27 non-getter- and setter-methods. Consider refactoring BlockBox to keep number of methods under 25. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class BlockBox has 25 public methods. Consider refactoring BlockBox to keep number of public methods under 10. Open
class BlockBox extends ElementBox implements BoxInterface, AppendChildInterface, BuildTreeInterface
{
/**
* @var \YetiForcePDF\Layout\LineBox
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class InlineBox has 13 public methods. Consider refactoring InlineBox to keep number of public methods under 10. Open
class InlineBox extends ElementBox implements BoxInterface, BuildTreeInterface, AppendChildInterface
{
/**
* @var \YetiForcePDF\Layout\TextBox
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class InlineBox has an overall complexity of 53 which is very high. The configured complexity threshold is 50. Open
class InlineBox extends ElementBox implements BoxInterface, BuildTreeInterface, AppendChildInterface
{
/**
* @var \YetiForcePDF\Layout\TextBox
*/
- Exclude checks
The class TableBox has 11 public methods. Consider refactoring TableBox to keep number of public methods under 10. Open
class TableBox extends BlockBox
{
/**
* @var array minimal widths
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class Box has 16 public methods. Consider refactoring Box to keep number of public methods under 10. Open
class Box extends \YetiForcePDF\Base
{
/**
* Id of this box (should be cloned to track inline wrapped elements).
*
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class LineBox has 14 public methods. Consider refactoring LineBox to keep number of public methods under 10. Open
class LineBox extends Box implements BoxInterface
{
/**
* Append block box element.
*
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class Box has an overall complexity of 157 which is very high. The configured complexity threshold is 50. Open
class Box extends \YetiForcePDF\Base
{
/**
* Id of this box (should be cloned to track inline wrapped elements).
*
- Exclude checks
The class Document has 13 public methods. Consider refactoring Document to keep number of public methods under 10. Open
class Document
{
/**
* Actual id auto incremented.
*
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The class Document has an overall complexity of 101 which is very high. The configured complexity threshold is 50. Open
class Document
{
/**
* Actual id auto incremented.
*
- Exclude checks
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
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 {