MAXakaWIZARD/xls-writer

View on GitHub

Showing 58 of 58 total issues

File Worksheet.php has 617 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Xls;

class Worksheet extends BIFFwriter
Severity: Major
Found in src/Worksheet.php - About 1 day to fix

    Worksheet has 70 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Worksheet extends BIFFwriter
    {
        const BOF_TYPE = 0x0010;
    
        const STATE_VISIBLE = 0x00;
    Severity: Major
    Found in src/Worksheet.php - About 1 day to fix

      File FormulaParser.php has 437 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace Xls;
      
      class FormulaParser
      Severity: Minor
      Found in src/FormulaParser.php - About 6 hrs to fix

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

        class FormulaParser
        {
            /**
             * The index of the character we are currently looking at
             * @var integer
        Severity: Minor
        Found in src/FormulaParser.php - About 5 hrs to fix

          File Workbook.php has 388 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          namespace Xls;
          
          use Xls\OLE\PpsFile;
          use Xls\OLE\PpsRoot;
          Severity: Minor
          Found in src/Workbook.php - About 5 hrs to fix

            Function getBlocksSizesOrDataToWrite has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getBlocksSizesOrDataToWrite($tmpBlockSizes = null, $returnDataToWrite = false)
                {
                    $continueLimit = Biff8::CONTINUE_LIMIT;
                    $blockLength = 0;
                    $written = 0;
            Severity: Minor
            Found in src/SharedStringsTable.php - About 5 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

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

            class Workbook extends BIFFwriter
            {
                const COUNTRY_NONE = -1;
                const COUNTRY_USA = 1;
            
            
            Severity: Minor
            Found in src/Workbook.php - About 5 hrs to fix

              PrintSetup has 36 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class PrintSetup
              {
                  const ORIENTATION_PORTRAIT = 1;
                  const ORIENTATION_LANDSCAPE = 0;
              
              
              Severity: Minor
              Found in src/PrintSetup.php - About 4 hrs to fix

                File Functions.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace Xls;
                
                class Functions
                Severity: Minor
                Found in src/Functions.php - About 3 hrs to fix

                  Method getAll has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function getAll()
                      {
                          return array(
                              'ptgExp' => 0x01,
                              'ptgTbl' => 0x02,
                  Severity: Major
                  Found in src/Ptg.php - About 3 hrs to fix

                    Format has 29 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Format
                    {
                        const BORDER_NONE = 0;
                        const BORDER_THIN = 1;
                        const BORDER_THICK = 2;
                    Severity: Minor
                    Found in src/Format.php - About 3 hrs to fix

                      File PpsRoot.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace Xls\OLE;
                      
                      class PpsRoot extends PPS
                      Severity: Minor
                      Found in src/OLE/PpsRoot.php - About 2 hrs to fix

                        Font has 24 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Font
                        {
                            const FONT_NORMAL = 400;
                            const FONT_BOLD = 700;
                        
                        
                        Severity: Minor
                        Found in src/Font.php - About 2 hrs to fix

                          Method getBlocksSizesOrDataToWrite has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getBlocksSizesOrDataToWrite($tmpBlockSizes = null, $returnDataToWrite = false)
                              {
                                  $continueLimit = Biff8::CONTINUE_LIMIT;
                                  $blockLength = 0;
                                  $written = 0;
                          Severity: Major
                          Found in src/SharedStringsTable.php - About 2 hrs to fix

                            Method saveBigBlockChain has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function saveBigBlockChain($numSbBlocks, $numBbBlocks, $numPpsBlocks)
                                {
                                    $info = $this->calcBigBlockChain($numSbBlocks, $numBbBlocks, $numPpsBlocks);
                                    $headerEntriesCount = $info["header_list_entries"];
                                    $entriesCount = $info["list_entries"];
                            Severity: Major
                            Found in src/OLE/PpsRoot.php - About 2 hrs to fix

                              Function saveBigBlockChain has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected function saveBigBlockChain($numSbBlocks, $numBbBlocks, $numPpsBlocks)
                                  {
                                      $info = $this->calcBigBlockChain($numSbBlocks, $numBbBlocks, $numPpsBlocks);
                                      $headerEntriesCount = $info["header_list_entries"];
                                      $entriesCount = $info["list_entries"];
                              Severity: Minor
                              Found in src/OLE/PpsRoot.php - About 1 hr 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 getStatisticalFunctions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected static function getStatisticalFunctions()
                                  {
                                      return array(
                                          // function ptg  args  class  vol
                                          'AVERAGE' => array(5, -1, 0, 0),
                              Severity: Minor
                              Found in src/Functions.php - About 1 hr to fix

                                Method positionImage has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function positionImage($colStart, $rowStart, $x1, $y1, $width, $height)
                                    {
                                        // Initialise end cell to the same as the start cell
                                        $colEnd = $colStart; // Col containing lower right corner of object
                                        $rowEnd = $rowStart; // Row containing bottom right corner of object
                                Severity: Minor
                                Found in src/Worksheet.php - About 1 hr to fix

                                  Function saveSmallData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function saveSmallData(&$list)
                                      {
                                          $result = '';
                                          $iSmBlk = 0;
                                          foreach ($list as $item) {
                                  Severity: Minor
                                  Found in src/OLE/PpsRoot.php - About 1 hr 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 getMathFunctions has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected static function getMathFunctions()
                                      {
                                          return array(
                                              // function ptg  args  class  vol
                                              'SUM' => array(4, -1, 0, 0),
                                  Severity: Minor
                                  Found in src/Functions.php - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language