File DisplayLib.php
has 677 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2012 Whole Foods Co-op
Consider simplifying this complex logical expression. Open
if ($row['trans_status'] == 'V' || $row['trans_type'] == 'T' || $row['trans_status'] == 'R' || $row['trans_status'] == 'M' || $row['voided'] == 17 || $row['trans_status'] == 'J') {
return '800000';
} elseif (($row['discounttype'] != 0 && ($row['matched'] > 0 || $row['volDiscType'] == 0))
|| $row['voided'] == 2 || $row['voided'] == 6 || $row['voided'] == 4 || $row['voided'] == 5 || $row['voided'] == 10 || $row['voided'] == 22) {
return '408080';
DisplayLib
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class DisplayLib
{
/**
Get the standard footer with total and
Function printfooter
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
static public function printfooter($readOnly=False)
{
$FOOTER_MODULES = CoreLocal::get("FooterModules");
// use defaults if modules haven't been configured
// properly
- 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 printfooter
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function printfooter($readOnly=False)
{
$FOOTER_MODULES = CoreLocal::get("FooterModules");
// use defaults if modules haven't been configured
// properly
Consider simplifying this complex logical expression. Open
if ($row['discounttype'] == 3 && $row['trans_status'] == 'V') {
return $row['ItemQtty'] . ' /' . $row['unitPrice'];
} elseif ($row['voided'] == 5) {
return 'Discount';
} elseif ($row['trans_status'] == 'M') {
Function scaledisplaymsg
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
static public function scaledisplaymsg($input="")
{
$reginput = trim(strtoupper($input));
$scans = '';
- 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 touchScreenKeyboard
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function touchScreenKeyboard($selector='#reginput')
{
return '
<button type="button" class="pos-button" style="width: 25px;"
onclick="s=$(\'' . $selector . '\').val(); $(\'' . $selector . '\').val(s + \'Q\');">Q</button>
Function screenDisplayComment
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
static private function screenDisplayComment($row)
{
if ($row['discounttype'] == 3 && $row['trans_status'] == 'V') {
return $row['ItemQtty'] . ' /' . $row['unitPrice'];
} elseif ($row['voided'] == 5) {
- 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 scaledisplaymsg
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function scaledisplaymsg($input="")
{
$reginput = trim(strtoupper($input));
$scans = '';
Method printheaderb
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function printheaderb()
{
$strmemberID = "";
if (CoreLocal::get("memberID") != "0") {
Method drawItems
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function drawItems($topItem, $rows, $highlight)
{
$ret = self::printheaderb();
$query = "select count(*) as count from localtemptrans";
Function drawItems
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static public function drawItems($topItem, $rows, $highlight)
{
$ret = self::printheaderb();
$query = "select count(*) as count from localtemptrans";
- 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 msgbox
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function msgbox($strmsg, $icon, $noBeep=false, $buttons=array())
{
$ret = self::printheaderb();
$ret .= "<div id=\"boxMsg\" class=\"centeredDisplay\">";
$ret .= "<div class=\"boxMsgAlert coloredArea\">";
Method screenDisplayComment
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
static private function screenDisplayComment($row)
{
if ($row['discounttype'] == 3 && $row['trans_status'] == 'V') {
return $row['ItemQtty'] . ' /' . $row['unitPrice'];
} elseif ($row['voided'] == 5) {
Function screenDisplayStatus
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static private function screenDisplayStatus($row)
{
if ($row['trans_status'] == 'V') {
return 'VD';
} elseif ($row['trans_status'] == 'R') {
- 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
Consider simplifying this complex logical expression. Open
if ($row['trans_status'] == 'V') {
return 'VD';
} elseif ($row['trans_status'] == 'R') {
return 'RF';
} elseif ($row['trans_status'] == 'C') {
Function screenDisplayColor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static private function screenDisplayColor($row)
{
if ($row['trans_status'] == 'V' || $row['trans_type'] == 'T' || $row['trans_status'] == 'R' || $row['trans_status'] == 'M' || $row['voided'] == 17 || $row['trans_status'] == 'J') {
return '800000';
} elseif (($row['discounttype'] != 0 && ($row['matched'] > 0 || $row['volDiscType'] == 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 msgbox
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static public function msgbox($strmsg, $icon, $noBeep=false, $buttons=array())
{
$ret = self::printheaderb();
$ret .= "<div id=\"boxMsg\" class=\"centeredDisplay\">";
$ret .= "<div class=\"boxMsgAlert coloredArea\">";
- 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 $row['volume'] . ' for ' . $row['unitPrice'];
Avoid too many return
statements within this method. Open
return _('Discount');
Avoid too many return
statements within this method. Open
return '004080';
Avoid too many return
statements within this method. Open
return array('', "style=\"background:#$color;color:#ffffff;\"");
Avoid too many return
statements within this method. Open
return $row['quantity'] . ' @ ' . $row['unitPrice'];
Avoid too many return
statements within this method. Open
return $row['description'];
Avoid too many return
statements within this method. Open
return substr($row['tax_description'], 0 , 1);
Avoid too many return
statements within this method. Open
return $row['upc'];
Avoid too many return
statements within this method. Open
return 'TF';
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return array('', "style=\"color:#$color;\"");
Avoid too many return
statements within this method. Open
return $row['quantity'] . ' @ ' . $row['volume'] . ' for ' . $row['unitPrice'];
Avoid too many return
statements within this method. Open
return _('1 w/ vol adj');
Avoid too many return
statements within this method. Open
return 'F';
Avoid too many return
statements within this method. Open
return $row['ItemQtty'] . ' / ' . $row['unitPrice'];
Avoid too many return
statements within this method. Open
return 'T';
Avoid too many return
statements within this method. Open
return $row['ItemQtty'] . ' @ ' . $row['unitPrice'];
Avoid too many return
statements within this method. Open
return _('Total ');
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return substr($row['tax_description'], 0 , 1) . 'F';
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return $row['ItemQtty'] . ' @ ' . $row['regPrice'];