Method programOK
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function programOK($pKey='', $conn='')
{
global $CORE_LOCAL;
if (!$CORE_LOCAL->get("memberID")) {
Function programOK
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
static public function programOK($pKey='', $conn='')
{
global $CORE_LOCAL;
if (!$CORE_LOCAL->get("memberID")) {
- 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 getCCredSubtotals
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function getCCredSubtotals($tender, $conn,
$programCode='', $table='', $ref='')
{
global $CORE_LOCAL;
Function getCCredSubtotals
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static public function getCCredSubtotals($tender, $conn,
$programCode='', $table='', $ref='')
{
global $CORE_LOCAL;
- 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 getCCredSubtotals
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
static public function getCCredSubtotals($tender, $conn,
$programCode='', $table='', $ref='')
Avoid too many return
statements within this method. Open
return _("Member ") .
$CORE_LOCAL->get("memberID") .
_(" is not registered for ") .
$CORE_LOCAL->get("{$programCode}programName") .
".";
Avoid too many return
statements within this method. Open
return _("Member #") .
$CORE_LOCAL->get("memberID") .
_(" may not transfer Coop Cred to another Member") .
".";
Avoid too many return
statements within this method. Open
return _("Member #") .
$CORE_LOCAL->get("memberID") .
_(" may not pay into ") .
$CORE_LOCAL->get("{$programCode}programName") .
".";
Avoid too many return
statements within this method. Open
return True;
Avoid too many return
statements within this method. Open
return $pgm->programName() . _(" hasn't started yet.");
Avoid too many return
statements within this method. Open
return $pgm->programName() . _(" is no longer operating.");
Avoid too many return
statements within this method. Open
return "Error: execute() failed for query: $query args:" .
implode('|',$args);
Avoid too many return
statements within this method. Open
return _("Member #") .
$CORE_LOCAL->get("memberID") .
_(" is registered for ") .
'<b>'. $CORE_LOCAL->get("{$programCode}programName"). '</b>' .
_(" but may not use it") .
Avoid too many return
statements within this method. Open
return $pgm->programName() . _(" is not accepting purchases at this time.");
Avoid too many return
statements within this method. Open
return $pgm->programName() . _(" is not active.");
Avoid too many return
statements within this method. Open
return "Error: prepare() failed for query: $query";
Function addDepartmentUsed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static public function addDepartmentUsed($paymentDepartment=0,$programID=0)
{
global $CORE_LOCAL;
/* I think it could default to using the current ones set by programOK()
- 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"