File FormulaParser.php
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Xls;
class FormulaParser
FormulaParser
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class FormulaParser
{
/**
* The index of the character we are currently looking at
* @var integer
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 "("
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.
- Read upRead up
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
Function advance
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function advance()
{
$token = '';
$position = $this->eatWhitespace();
- Read upRead up
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
- Read upRead up
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 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)) {
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if ($this->isReference($token)
|| $this->isExternalReference($token)
|| $this->isAnyRange($token)
|| $this->isNumber($token)
|| Token::isString($token)
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 "("
- Read upRead up
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 '';
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $this->convertRange3d($token);
Avoid too many return
statements within this method. Open
return pack("C", Ptg::get($token));
Avoid too many return
statements within this method. Open
return $this->convertRange2d($token);