Showing 7 of 848 total issues
File PelecardPaymentStatus.php
has 783 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @file PelecardPaymentStatus class - allows to get payment status message based on status code
*/
namespace Pelecard;
Method __construct
has 33 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct($terminal, $user, $password, $GoodURL, $Total, $ErrorURL = NULL, $ActionType = 'J4', $Currency = 1, $FreeTotal = 'False',
$CreateToken = 'False', $Language = 'HE', $CardHolderName = 'hide', $CustomerIdField = 'optional', $Cvv2Field = 'optional',
$EmailField = 'hide', $TelField = 'hide', $SplitCCNumber = 'False', $FeedbackOnTop = 'False', $UseBuildInFeedbackPage = 'False',
$MaxPayments = 12, $MinPayments = 1, $MinPaymentsForCredit = 7, $FirstPayment = 'auto', $ShopNo = '001', $ParamX = '',
$ShowXParam = 'False', $AddHolderNameToXParam = 'False', $CssURL = 'https://gateway20.pelecard.biz/Content/Css/variant-he-1.css',
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($terminal, $user, $password, $GoodURL, $Total, $ErrorURL = NULL, $ActionType = 'J4', $Currency = 1, $FreeTotal = 'False',
$CreateToken = 'False', $Language = 'HE', $CardHolderName = 'hide', $CustomerIdField = 'optional', $Cvv2Field = 'optional',
$EmailField = 'hide', $TelField = 'hide', $SplitCCNumber = 'False', $FeedbackOnTop = 'False', $UseBuildInFeedbackPage = 'False',
$MaxPayments = 12, $MinPayments = 1, $MinPaymentsForCredit = 7, $FirstPayment = 'auto', $ShopNo = '001', $ParamX = '',
$ShowXParam = 'False', $AddHolderNameToXParam = 'False', $CssURL = 'https://gateway20.pelecard.biz/Content/Css/variant-he-1.css',
Function getMessage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getMessage() {
if (!is_string($this->code) || !array_key_exists($this->code, PelecardPaymentStatus::MESSAGES)) {
// invalid status code provided, should be string value
return null;
}
- 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 getMessage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getMessage() {
if (!is_string($this->code) || !array_key_exists($this->code, PelecardPaymentStatus::MESSAGES)) {
// invalid status code provided, should be string value
return null;
}
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct($PelecardStatusCode, $PelecardTransactionId, $ParamX, $UserKey, $ConfirmationKey, $TotalX100, $ApprovalNo = '', $Token = '') {
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {