Showing 56 of 58 total issues
Consider simplifying this complex logical expression. Open
if (($red < 0 || $red > 255)
|| ($green < 0 || $green > 255)
|| ($blue < 0 || $blue > 255)
) {
throw new \Exception("Color component outside range: 0 <= color <= 255");
Method getData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getData($x, $y, $rowTop, $colLeft, $activePane)
Method writeUrl
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function writeUrl($row, $col, $url, $label = '', $format = null)
Method setValidation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setValidation($row1, $col1, $row2, $col2, $validator)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$rowFrom = 0,
$colFrom = 0,
$rowTo = null,
$colTo = null,
$normalize = true
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) {
- 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 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);
Avoid too many return
statements within this method. Open
return null;
Function storeAllNumFormats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function storeAllNumFormats()
{
$map = array();
$index = 164;
- 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 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) {
- 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 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
- 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"