Showing 15 of 15 total issues
Method getCountryCodes
has 248 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getCountryCodes()
{
return array
(
'AF' => 'Afghanistan',
File Utilities.php
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Common functions that can be used across all methods
*/
Shared
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Shared extends AbstractSettings
{
/**
* Sets the connection mode for the API
Method getCurrencies
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getCurrencies()
{
return array(
'AFA' => array('Afghan Afghani', '971'),
'AWG' => array('Aruban Florin', '533'),
Method register
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function register($txType)
{
if (in_array(strtoupper($txType), $this->validTxTypes)) {
$txType = strtoupper($txType);
} else {
Method repeat
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function repeat()
{
$data = array(
'VPSProtocol' => $this->protocol,
'TxType' => "REPEAT",
Function toXml
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
private function toXml()
{
$dom = new \DOMDocument();
$dom->formatOutput = true;
$dom->loadXML('<basket></basket>');
- 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 setAddress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
public function setAddress($address1, $address2, $city, $country, $postcode, $state = false)
{
$countries = Utilities::getCountryCodes();
if (strlen($address1) > 100) {
- 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 toXml
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function toXml()
{
$dom = new \DOMDocument();
$dom->formatOutput = true;
$dom->loadXML('<basket></basket>');
Method setAddress
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setAddress($address1, $address2, $city, $country, $postcode, $state = false)
{
$countries = Utilities::getCountryCodes();
if (strlen($address1) > 100) {
Method authorise
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function authorise($VendorTxCode, $Amount, $RelatedVPSTxId, $RelatedVendorTxCode, $RelatedSecurityKey, $RelatedTxAuthNo, $Description = '')
Method refund
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function refund($VendorTxCode, $Amount, $RelatedVPSTxId, $RelatedVendorTxCode, $RelatedSecurityKey, $RelatedTxAuthNo, $Description = '')
Method setAddress
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function setAddress($address1, $address2, $city, $country, $postcode, $state = false)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function __construct($description, $unitNetAmount, $unitTaxAmount, $quantity = 1, $productCode = false, $productSku = false)
Method release
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function release($VPSTxId, $SecurityKey, $VendorTxCode, $TxAuthNo, $ReleaseAmount)