MAXakaWIZARD/xls-writer

View on GitHub

Showing 56 of 58 total issues

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

    Method getData has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getData($x, $y, $rowTop, $colLeft, $activePane)
    Severity: Minor
    Found in src/Record/Pane.php - About 35 mins to fix

      Method writeUrl has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function writeUrl($row, $col, $url, $label = '', $format = null)
      Severity: Minor
      Found in src/Worksheet.php - About 35 mins to fix

        Method setValidation has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function setValidation($row1, $col1, $row2, $col2, $validator)
        Severity: Minor
        Found in src/Worksheet.php - About 35 mins to fix

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

                  $rowFrom = 0,
                  $colFrom = 0,
                  $rowTo = null,
                  $colTo = null,
                  $normalize = true
          Severity: Minor
          Found in src/Range.php - About 35 mins to fix

            Function calcSize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function calcSize($list)
                {
                    $iSBcnt = 0;
                    $iBBcnt = 0;
                    foreach ($list as $item) {
            Severity: Minor
            Found in src/OLE/PpsRoot.php - About 35 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 fact has a Cognitive Complexity of 7 (exceeds 5 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 35 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

            Avoid too many return statements within this method.
            Open

                        return $this->convertRange3d($token);
            Severity: Major
            Found in src/FormulaParser.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return '';
              Severity: Major
              Found in src/FormulaParser.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $this->convertRange2d($token);
                Severity: Major
                Found in src/FormulaParser.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $result;
                  Severity: Major
                  Found in src/FormulaParser.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return pack("C", Ptg::get($token));
                    Severity: Major
                    Found in src/FormulaParser.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return null;
                      Severity: Major
                      Found in src/Worksheet.php - About 30 mins to fix

                        Function storeAllNumFormats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function storeAllNumFormats()
                            {
                                $map = array();
                                $index = 164;
                        
                        
                        Severity: Minor
                        Found in src/Workbook.php - About 25 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 calculateActivePane has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function calculateActivePane($x, $y)
                            {
                                if ($x != 0 && $y != 0) {
                                    return 0; // Bottom right
                                } elseif ($x != 0 && $y == 0) {
                        Severity: Minor
                        Found in src/Worksheet.php - About 25 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 positionImage has a Cognitive Complexity of 6 (exceeds 5 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 25 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

                        Severity
                        Category
                        Status
                        Source
                        Language