Showing 133 of 211 total issues
Consider simplifying this complex logical expression. Open
if ($pow == 1) {
$ret[$j] .= $this->showDigitsGroup(
$numGroups[$i],
0,
!$this->lastAnd && $i
Function transformToWords
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function transformToWords(int $number, int $power): string
{
$units = $number % 10;
$tens = (int) ($number / 10) % 10;
$hundreds = (int) ($number / 100) % 10;
- 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 deeply nested control flow statements. Open
if ($powsuffix != '') {
$cursuffix .= $this->wordSeparator . $powsuffix;
}
Avoid deeply nested control flow statements. Open
if ($gt2000) {
$return .= $this->thousandSeparator;
}
Function convertTriplet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function convertTriplet(string $chunk, $chunkLevel)
{
$triplet = (int)$chunk;
$units = $triplet % 10;
- 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 deeply nested control flow statements. Open
if ($powsuffix != '') {
$cursuffix .= $this->wordSeparator . $powsuffix;
}
Avoid deeply nested control flow statements. Open
if ($powsuffix != '') {
$cursuffix .= $this->wordSeparator . $powsuffix;
}
Avoid deeply nested control flow statements. Open
if ($powsuffix != '') {
$cursuffix .= $this->wordSeparator . $powsuffix;
}
Function getLevel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getLevel($number): int
{
$lastTwoDigits = $number % 100;
$lastDigit = $number % 10;
$isUnit = log($number) === 1;
- 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 transformToWords
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function transformToWords(int $number, int $power): string
{
$units = $number % 10;
$tens = (int) ($number / 10) % 10;
$hundreds = (int) ($number / 100) % 10;
- 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 getLevel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getLevel($number)
{
$lastTwoDigits = $number % 100;
$lastDigit = $number % 10;
$isUnit = log($number) === 1;
- 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 $ret;
Avoid too many return
statements within this method. Open
return 0;
Avoid too many return
statements within this method. Open
return 2;
Avoid too many return
statements within this method. Open
return $return;
Avoid too many return
statements within this method. Open
return $return;
Avoid too many return
statements within this method. Open
return $ret;
Avoid too many return
statements within this method. Open
return 0;
Avoid too many return
statements within this method. Open
return $return;
Avoid too many return
statements within this method. Open
return $ret;