MAXakaWIZARD/xls-writer

View on GitHub

Showing 58 of 58 total issues

Method getDistributionFunctions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Method saveSmallData has 30 lines of code (exceeds 25 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

      Method fact has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function fact()
          {
              if ($this->currentToken == Token::TOKEN_OPEN) {
                  $this->advance(); // eat the "("
      
      
      Severity: Minor
      Found in src/FormulaParser.php - About 1 hr to fix

        Method saveHeader has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function saveHeader($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

          Method save has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function save($filePath)
              {
                  if ($this->saved) {
                      throw new \Exception('Workbook was already saved!');
                  }
          Severity: Minor
          Found in src/Workbook.php - About 1 hr to fix

            Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $index = null,
                    $name = null,
                    $type = null,
                    $prev = null,
                    $next = null,
            Severity: Major
            Found in src/OLE/PPS.php - About 1 hr to fix

              Method getData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getData($sheet)
                  {
                      $printSetup = $sheet->getPrintSetup();
              
                      $iPaperSize = $printSetup->getPaperSize(); // Paper size
              Severity: Minor
              Found in src/Record/PageSetup.php - About 1 hr to fix

                Function getRangeSheets has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function getRangeSheets($extRef)
                    {
                        $extRef = $this->removeTrailingQuotes($extRef);
                
                        // Check if there is a sheet range eg., Sheet1:Sheet2.
                Severity: Minor
                Found in src/FormulaParser.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 func has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function func()
                    {
                        $numArgs = 0; // number of arguments received
                        $function = strtoupper($this->currentToken);
                        $result = ''; // initialize result
                Severity: Minor
                Found in src/FormulaParser.php - About 1 hr to fix

                  Method getData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getData(XlsFont $font)
                      {
                          $dyHeight = $font->getSize() * 20; // Height of font (1/20 of a point)
                          $icv = $font->getColor(); // Index to color palette
                          $bls = $font->getBold(); // Bold style
                  Severity: Minor
                  Found in src/Record/Font.php - About 1 hr to fix

                    Method getData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getData($objectId, Range $area, Margin $margin)
                        {
                            $objCount = 0x01; // Count of objects in file (set to 1)
                            $grbit = 0x0614; // Option flags
                            $data = pack("Vv3", $objCount, static::TYPE, $objectId, $grbit);
                    Severity: Minor
                    Found in src/Record/ObjPicture.php - About 1 hr to fix

                      Function advance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function advance()
                          {
                              $token = '';
                      
                              $position = $this->eatWhitespace();
                      Severity: Minor
                      Found in src/FormulaParser.php - About 55 mins 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 func has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function func()
                          {
                              $numArgs = 0; // number of arguments received
                              $function = strtoupper($this->currentToken);
                              $result = ''; // initialize result
                      Severity: Minor
                      Found in src/FormulaParser.php - About 55 mins 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 insertBitmap has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function insertBitmap($row, $col, $path, $x = 0, $y = 0, $scaleX = 1, $scaleY = 1)
                      Severity: Major
                      Found in src/Worksheet.php - About 50 mins to fix

                        Method positionImage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            protected function positionImage($colStart, $rowStart, $x1, $y1, $width, $height)
                        Severity: Minor
                        Found in src/Worksheet.php - About 45 mins to fix

                          Function convert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function convert($token)
                              {
                                  if (Token::isString($token)) {
                                      return $this->convertString($token);
                                  } elseif (is_numeric($token)) {
                          Severity: Minor
                          Found in src/FormulaParser.php - About 45 mins 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 saveBigData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function saveBigData($iStBlk, &$list)
                              {
                                  foreach ($list as $item) {
                                      $size = $item->getSize();
                                      if ($size >= self::DATA_SIZE_SMALL
                          Severity: Minor
                          Found in src/OLE/PpsRoot.php - About 45 mins 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 writeRow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function writeRow($row, $col, $val, $format = null)
                              {
                                  if (is_array($val)) {
                                      foreach ($val as $v) {
                                          if (is_array($v)) {
                          Severity: Minor
                          Found in src/Worksheet.php - About 45 mins 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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  $name,
                                  $index,
                                  $workbook,
                                  $sst,
                                  $urlFormat,
                          Severity: Minor
                          Found in src/Worksheet.php - About 45 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if ($this->isReference($token)
                                        || $this->isExternalReference($token)
                                        || $this->isAnyRange($token)
                                        || $this->isNumber($token)
                                        || Token::isString($token)
                            Severity: Major
                            Found in src/FormulaParser.php - About 40 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language