Showing 15,735 of 15,735 total issues
Function setGroupOptions
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function setGroupOptions(PageGroupBox $root, \DOMDocument $domDocument)
{
$childDomElement = $domDocument->documentElement->firstChild;
if (!$childDomElement instanceof \DOMElement) {
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 getOuterWidth
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getOuterWidth()
{
$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 addBorderInstructions
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addBorderInstructions(array $element, string $pdfX, string $pdfY, string $width, string $height)
{
if ('none' === $this->getStyle()->getRules('display')) {
return $element;
}
File BoxDimensions.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
/**
* BoxDimensions class.
Function getMaxWidth
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getMaxWidth()
{
$box = $this->getBox();
if (!$box->isForMeasurement()) {
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
The class Style has an overall complexity of 191 which is very high. The configured complexity threshold is 50. Open
class Style extends \YetiForcePDF\Base
{
/**
* @var \YetiForcePDF\Document
*/
- Exclude checks
The class Style has 14 public methods. Consider refactoring Style to keep number of public methods under 10. Open
class Style extends \YetiForcePDF\Base
{
/**
* @var \YetiForcePDF\Document
*/
- 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 Font has an overall complexity of 78 which is very high. The configured complexity threshold is 50. Open
class Font extends \YetiForcePDF\Objects\Resource
{
protected static $fontFiles = [
'DejaVu Sans' => [
'100' => [
- 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 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 Page has 14 public methods. Consider refactoring Page to keep number of public methods under 10. Open
class Page extends \YetiForcePDF\Objects\Basic\DictionaryObject
{
/**
* @var int
*/
- 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 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 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 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 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 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 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 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