YetiForceCompany/YetiForcePDF

View on GitHub

Showing 154 of 15,728 total issues

File Style.php has 1259 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);
/**
 * Style class.
Severity: Major
Found in lib/Style/Style.php - About 3 days to fix

    File TableBox.php has 979 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    /**
     * TableBox class.
    Severity: Major
    Found in lib/Layout/TableBox.php - About 2 days to fix

      File Page.php has 934 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      declare(strict_types=1);
      /**
       * Page class.
      Severity: Major
      Found in lib/Page.php - About 2 days to fix

        Function fixTables has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
        Open

            public function fixTables()
            {
                $box = $this->getBox();
                if ($box->wasCut()) {
                    return $this;
        Severity: Minor
        Found in lib/Style/Style.php - About 1 day 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 fixTables has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
        Open

            public function fixTables()
            {
                $tables = $this->getBoxesByType('TableWrapperBox');
                foreach ($tables as $tableWrapperBox) {
                    $tableBox = $tableWrapperBox->getFirstChild();
        Severity: Minor
        Found in lib/Layout/ElementBox.php - About 1 day 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 measureHeight has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
        Open

            public function measureHeight(bool $afterPageDividing = false)
            {
                if ($this->wasCut()) {
                    return $this;
                }
        Severity: Minor
        Found in lib/Layout/TableBox.php - About 1 day 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

        File Box.php has 679 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        declare(strict_types=1);
        /**
         * Box class.
        Severity: Major
        Found in lib/Layout/Box.php - About 1 day to fix

          Box has 62 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Box extends \YetiForcePDF\Base
          {
              /**
               * Id of this box (should be cloned to track inline wrapped elements).
               *
          Severity: Major
          Found in lib/Layout/Box.php - About 1 day to fix

            Function divideTable has a Cognitive Complexity of 56 (exceeds 5 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);
            Severity: Minor
            Found in lib/Page.php - About 1 day 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

            Style has 60 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Style extends \YetiForcePDF\Base
            {
                /**
                 * @var \YetiForcePDF\Document
                 */
            Severity: Major
            Found in lib/Style/Style.php - About 1 day to fix

              File BlockBox.php has 517 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              declare(strict_types=1);
              /**
               * BlockBox class.
              Severity: Major
              Found in lib/Layout/BlockBox.php - About 1 day to fix

                File Document.php has 446 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                Severity: Minor
                Found in lib/Document.php - About 6 hrs to fix

                  Document has 48 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  Severity: Minor
                  Found in lib/Document.php - About 6 hrs to fix

                    File Font.php has 436 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    declare(strict_types=1);
                    /**
                     * Font class.
                    Severity: Minor
                    Found in lib/Objects/Font.php - About 6 hrs to fix

                      Function divide has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function divide()
                          {
                              $lines = [];
                              $line = (new self())
                                  ->setDocument($this->document)
                      Severity: Minor
                      Found in lib/Layout/LineBox.php - About 6 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 buildTree has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function buildTree($parentBlock = null)
                          {
                              if ($this->getElement()) {
                                  $domElement = $this->getElement()->getDOMElement();
                              } else {
                      Severity: Minor
                      Found in lib/Layout/ElementBox.php - About 6 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

                      Page has 40 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Page extends \YetiForcePDF\Objects\Basic\DictionaryObject
                      {
                          /**
                           * @var int
                           */
                      Severity: Minor
                      Found in lib/Page.php - About 5 hrs to fix

                        TableBox has 39 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class TableBox extends BlockBox
                        {
                            /**
                             * @var array minimal widths
                             */
                        Severity: Minor
                        Found in lib/Layout/TableBox.php - About 5 hrs to fix

                          Method measureHeight has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function measureHeight(bool $afterPageDividing = false)
                              {
                                  if ($this->wasCut()) {
                                      return $this;
                                  }
                          Severity: Major
                          Found in lib/Layout/TableBox.php - About 5 hrs to fix

                            Function spanRows has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function spanRows()
                                {
                                    $toRemove = [];
                                    foreach ($this->getChildren() as $rowGroup) {
                                        foreach ($rowGroup->getChildren() as $rowIndex => $row) {
                            Severity: Minor
                            Found in lib/Layout/TableBox.php - About 4 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

                            Severity
                            Category
                            Status
                            Source
                            Language