Function setAltMemMsg
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
static public function setAltMemMsg($store, $member, $row)
{
if ($store == 'WEFC_Toronto') {
$chargeOk = self::chargeOk();
/* Doesn't quite allow for StoreCharge/PrePay for regular members
- 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 setAltMemMsg
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function setAltMemMsg($store, $member, $row)
{
if ($store == 'WEFC_Toronto') {
$chargeOk = self::chargeOk();
/* Doesn't quite allow for StoreCharge/PrePay for regular members
File MemberLib.php
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2016 Whole Foods Co-op
Method setMember
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function setMember($member, $personNumber, $row=array())
{
$conn = Database::pDataConnect();
/**
Function checkUnpaidAR
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static public function checkUnpaidAR($cardno)
{
// only attempt if server is available
// and not the default non-member
if ($cardno == \CoreLocal::get('defaultNonMem') || \CoreLocal::get('balance') == 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
Method memberID
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function memberID($memberNumber)
{
$query = "
SELECT CardNo,
personNum
Method checkUnpaidAR
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function checkUnpaidAR($cardno)
{
// only attempt if server is available
// and not the default non-member
if ($cardno == \CoreLocal::get('defaultNonMem') || \CoreLocal::get('balance') == 0) {
Function setMember
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static public function setMember($member, $personNumber, $row=array())
{
$conn = Database::pDataConnect();
/**
- 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 deeply nested control flow statements. Open
if ($ccR === False) {
\CoreLocal::set("memMsg", $memMsg . "Query failed");
return;
}
Avoid deeply nested control flow statements. Open
if ($ccS === False) {
\CoreLocal::set("memMsg", $memMsg . "Prep failed");
return;
}
Avoid deeply nested control flow statements. Open
while ($row = $conn->fetchRow($ccR)) {
$programOK = \CoopCredLib::programOK($row['tenderType'], $conn);
if ($programOK === True) {
$programCode = 'CCred' . \CoreLocal::get("CCredProgramID");
$tenderKeyCap = (\CoreLocal::get("{$programCode}tenderKeyCap") != "")
Avoid deeply nested control flow statements. Open
if ($message != "") {
\CoreLocal::set("memMsg", $memMsg . "$message");
return;
}
Function defaultMemMsg
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static private function defaultMemMsg($member, $row)
{
/**
Determine what string is shown in the upper
left of the screen to indicate the current member
- 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 deeply nested control flow statements. Open
if ($conn->numRows($ccR) == 0) {
\CoreLocal::set("memMsg", $memMsg);
return;
}
Function memberID
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static public function memberID($memberNumber)
{
$query = "
SELECT CardNo,
personNum
- 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;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;