File MercuryE2E.php
has 818 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2012 Whole Foods Co-op
Method lookupTransaction
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function lookupTransaction($ref, $local, $mode)
{
$wsParams = array(
'merchant' => $this->conf->get('MercuryE2ETerminalID'),
'pw' => $this->conf->get('MercuryE2EPassword'),
Method cleanup
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cleanup($json)
{
switch ($this->conf->get("paycard_mode")) {
case PaycardLib::PAYCARD_MODE_ADDVALUE:
case PaycardLib::PAYCARD_MODE_ACTIVATE:
Method handleResponseAuth
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleResponseAuth($authResult)
{
$resp = $this->desoapify("CreditTransactionResult",
$authResult["response"]);
$xml = new XmlData($resp);
Function lookupTransaction
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function lookupTransaction($ref, $local, $mode)
{
$wsParams = array(
'merchant' => $this->conf->get('MercuryE2ETerminalID'),
'pw' => $this->conf->get('MercuryE2EPassword'),
- 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 sendAuth
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sendAuth($domain="w1.mercurypay.com")
{
// initialize
$dbTrans = PaycardLib::paycard_db();
if (!$dbTrans) {
MercuryE2E
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class MercuryE2E extends BasicCCModule
{
private $voidTrans;
private $voidRef;
protected $SOAPACTION = "http://www.mercurypay.com/CreditTransaction";
Function handleResponseAuth
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function handleResponseAuth($authResult)
{
$resp = $this->desoapify("CreditTransactionResult",
$authResult["response"]);
$xml = new XmlData($resp);
- 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 cleanup
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function cleanup($json)
{
switch ($this->conf->get("paycard_mode")) {
case PaycardLib::PAYCARD_MODE_ADDVALUE:
case PaycardLib::PAYCARD_MODE_ACTIVATE:
- 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 sendVoid
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sendVoid($skipReversal=False,$domain="w1.mercurypay.com")
{
// initialize
$dbTrans = PaycardLib::paycard_db();
if (!$dbTrans){
Method handleResponseVoid
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleResponseVoid($authResult)
{
$resp = $this->desoapify("CreditTransactionResult",
$authResult["response"]);
$xml = new XmlData($resp);
Function sendAuth
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function sendAuth($domain="w1.mercurypay.com")
{
// initialize
$dbTrans = PaycardLib::paycard_db();
if (!$dbTrans) {
- 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 beginXmlRequest
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function beginXmlRequest($request, $refNo=false, $recordNo=false, $tipped=false)
{
$termID = $this->getTermID();
$separateID = false;
if (substr($termID, -2) == '::') {
Function beginXmlRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function beginXmlRequest($request, $refNo=false, $recordNo=false, $tipped=false)
{
$termID = $this->getTermID();
$separateID = false;
if (substr($termID, -2) == '::') {
- 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 handleResponseVoid
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function handleResponseVoid($authResult)
{
$resp = $this->desoapify("CreditTransactionResult",
$authResult["response"]);
$xml = new XmlData($resp);
- 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 sendVoid
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function sendVoid($skipReversal=False,$domain="w1.mercurypay.com")
{
// initialize
$dbTrans = PaycardLib::paycard_db();
if (!$dbTrans){
- 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 PaycardLib::PAYCARD_ERR_PROC;
Avoid too many return
statements within this method. Open
return PaycardLib::PAYCARD_ERR_NSF_RETRY;
Avoid too many return
statements within this method. Open
return PaycardLib::PAYCARD_ERR_PROC;