YetiForceCompany/YetiForcePDF

View on GitHub

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;
Severity: Minor
Found in lib/Html/Parser.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

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';
Severity: Minor
Found in lib/Layout/Dimensions/BoxDimensions.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 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;
        }
Severity: Major
Found in lib/Layout/Box.php - About 3 hrs to fix

    File BoxDimensions.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      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';
      Severity: Minor
      Found in lib/Layout/Dimensions/BoxDimensions.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

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

      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
           */
      Severity: Minor
      Found in lib/Style/Style.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 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' => [
      Severity: Minor
      Found in lib/Objects/Font.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 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 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
           */
      Severity: Minor
      Found in lib/Page.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 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 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 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 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 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 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 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
      Severity
      Category
      Status
      Source
      Language