Showing 91 of 100 total issues
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 eat8
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function eat8 () : int
{
$la = Specifications::lengthIndicator(QR_MODE_AN, $this->input->getVersion());
$ln = Specifications::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
- 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
Specifications
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Specifications
{
public static $capacity = [
[0, 0, 0, [0, 0, 0, 0]],
[21, 26, 0, [7, 10, 13, 17]], // 1
Input
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Input
{
public $items;
private $version;
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
Function init_rs_char
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function init_rs_char ($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
{
// Common code for intializing a Reed-Solomon control block (char or int symbols)
// Copyright 2004 Phil Karn, KA9Q
// May be used under the terms of the GNU Lesser General Public License (LGPL)
- 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 init_rs
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function init_rs ($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
{
foreach (self::$items as $rs) {
if ($rs->pad != $pad) continue;
if ($rs->nroots != $nroots) continue;
- 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 debug
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function debug ($frame, $binary_mode = false)
{
if ($binary_mode) {
foreach ($frame as &$frameLine) {
Function next
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function next ()
{
do {
if ($this->bit == -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
Method init_rs_char
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function init_rs_char ($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
{
// Common code for intializing a Reed-Solomon control block (char or int symbols)
// Copyright 2004 Phil Karn, KA9Q
// May be used under the terms of the GNU Lesser General Public License (LGPL)
Function eatAn
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function eatAn () : int
{
$la = Specifications::lengthIndicator(QR_MODE_AN, $this->input->getVersion());
$ln = Specifications::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
- 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;
Method encodeMask
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function encodeMask (Input $input, $mask)
{
if ($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) {
throw new \Exception('wrong version');
}
Method vectEPS
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function vectEPS ($frame, int $pixelPerPoint = 4, int $outerFrame = 4, int $backColor = 0xFFFFFF, int $foreColor = 0x000000, bool $cmyk = false) : string
{
$h = count($frame);
$w = strlen($frame[0]);
Method createFrame
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createFrame ($version)
{
$width = self::$capacity[$version][QRCAP_WIDTH];
$frameLine = str_repeat("\0", $width);
$frame = array_fill(0, $width, $frameLine);
Function splitString
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function splitString () : int
{
while (strlen($this->dataStr) > 0) {
if ($this->dataStr == '')
return 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 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
Method eat8
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function eat8 () : int
{
$la = Specifications::lengthIndicator(QR_MODE_AN, $this->input->getVersion());
$ln = Specifications::lengthIndicator(QR_MODE_NUM, $this->input->getVersion());
Function encodeMask
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function encodeMask (Input $input, $mask)
{
if ($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) {
throw new \Exception('wrong version');
}
- 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"