YetiForceCompany/YetiForcePDF

View on GitHub

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.
     *
Severity: Minor
Found in lib/Layout/LineBox.php by phpmd

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
     */
Severity: Minor
Found in lib/Layout/BlockBox.php by phpmd

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
     */
Severity: Minor
Found in lib/Layout/BlockBox.php by phpmd

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
     */
Severity: Minor
Found in lib/Layout/InlineBox.php by phpmd

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
     */
Severity: Minor
Found in lib/Layout/InlineBox.php by phpmd

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
     */
Severity: Minor
Found in lib/Layout/TableBox.php by phpmd

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).
     *
Severity: Minor
Found in lib/Layout/Box.php by phpmd

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.
     *
Severity: Minor
Found in lib/Layout/LineBox.php by phpmd

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).
     *
Severity: Minor
Found in lib/Layout/Box.php by phpmd

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.
     *
Severity: Minor
Found in lib/Document.php by phpmd

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.
     *
Severity: Minor
Found in lib/Document.php by phpmd

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
     */
Severity: Minor
Found in lib/Layout/ElementBox.php by phpmd

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
     */
Severity: Minor
Found in lib/Page.php by phpmd

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
     */

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
     */
Severity: Minor
Found in lib/Layout/TableBox.php by phpmd

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
     */
Severity: Minor
Found in lib/Layout/BlockBox.php by phpmd

File LineBox.php has 303 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);
/**
 * LineBox class.
Severity: Minor
Found in lib/Layout/LineBox.php - About 3 hrs to fix

    Function parse has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function parse()
        {
            if ($this->parsed) {
                return $this;
            }
    Severity: Minor
    Found in lib/Style/Style.php - About 3 hrs to fix

    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;
            }
    Severity: Major
    Found in lib/Style/Style.php - About 3 hrs to fix

      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 {
      Severity: Major
      Found in lib/Layout/ElementBox.php - About 3 hrs to fix
        Severity
        Category
        Status
        Source
        Language