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
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) {
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 createFrame
has a Cognitive Complexity of 14 (exceeds 5 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);
- 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 newFrame
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function newFrame ($version)
{
if ($version < 1 || $version > QRSPEC_VERSION_MAX)
return null;
- 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 putAlignmentPattern
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function putAlignmentPattern ($version, &$frame, $width)
{
if ($version < 2)
return;
Function putAlignmentPattern
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function putAlignmentPattern ($version, &$frame, $width)
{
if ($version < 2)
return;
- 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 debug
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function debug ($frame, $binary_mode = false)
{
if ($binary_mode) {
foreach ($frame as &$frameLine) {
- 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"