File AuthorizeDotNet.php
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2007,2010 Whole Foods Co-op
Method sendAuth
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sendAuth()
{
// initialize
$dbTrans = PaycardLib::paycard_db();
if( !$dbTrans){
Method sendVoid
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sendVoid()
{
// initialize
$dbTrans = PaycardLib::paycard_db();
if( !$dbTrans){
Method handleResponseAuth
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleResponseAuth($authResult)
{
$xml = new XmlData($authResult['response']);
$request = $this->last_request;
$this->last_paycard_transaction_id = $request->last_paycard_transaction_id;
Function responseReturn
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function responseReturn($xml)
{
switch ($xml->get("RESPONSECODE")) {
case 1: // APPROVED
return PaycardLib::PAYCARD_ERR_OK;
- 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 responseReturn
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function responseReturn($xml)
{
switch ($xml->get("RESPONSECODE")) {
case 1: // APPROVED
return PaycardLib::PAYCARD_ERR_OK;
Function cleanup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function cleanup($json)
{
switch($this->conf->get("paycard_mode")){
case PaycardLib::PAYCARD_MODE_AUTH:
// cast to string. tender function expects string input
- 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 sendAuth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function sendAuth()
{
// 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"