Function evaluateSymbol
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function evaluateSymbol (int $width, array $frame)
{
$head = 0;
$demerit = 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 calcN1N3
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function calcN1N3 ($length)
{
$demerit = 0;
for ($i = 0; $i < $length; $i++) {
- 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 evaluateSymbol
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function evaluateSymbol (int $width, array $frame)
{
$head = 0;
$demerit = 0;
Function makeMaskNo
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function makeMaskNo ($maskNo, $width, $s, &$d, $maskGenOnly = false)
{
$b = 0;
$bitMask = [];
- 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 writeFormatInformation
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function writeFormatInformation (int $width, array &$frame, int $mask, int $level) : int
{
$blacks = 0;
$format = Specifications::getFormatInfo($mask, $level);
- 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 writeFormatInformation
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function writeFormatInformation (int $width, array &$frame, int $mask, int $level) : int
{
$blacks = 0;
$format = Specifications::getFormatInfo($mask, $level);
Method mask
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mask (int $width, array $frame, int $level) : array
{
$minDemerit = PHP_INT_MAX;
$bestMaskNum = 0;
$bestMask = [];
Method makeMaskNo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeMaskNo ($maskNo, $width, $s, &$d, $maskGenOnly = false)
{
$b = 0;
$bitMask = [];
Avoid deeply nested control flow statements. Open
if (($this->runLength[$i - 3] < 0) || ($this->runLength[$i - 3] >= (4 * $fact))) {
$demerit += N3;
} elseif ((($i + 3) >= $length) || ($this->runLength[$i + 3] >= (4 * $fact))) {
$demerit += N3;
}
Method makeMaskNo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function makeMaskNo ($maskNo, $width, $s, &$d, $maskGenOnly = false)
Function generateMaskNo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function generateMaskNo ($maskNo, int $width, array $frame) : array
{
$bitMask = array_fill(0, $width, array_fill(0, $width, 0));
for ($y = 0; $y < $width; $y++) {
- 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 mask
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function mask (int $width, array $frame, int $level) : array
{
$minDemerit = PHP_INT_MAX;
$bestMaskNum = 0;
$bestMask = [];
- 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"