dofinity/pelecard

View on GitHub

Showing 7 of 848 total issues

File PelecardPaymentStatus.php has 783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @file PelecardPaymentStatus class - allows to get payment status message based on status code
 */
namespace Pelecard;
Severity: Major
Found in src/Pelecard/PelecardPaymentStatus.php - About 1 day to fix

    Method __construct has 33 arguments (exceeds 4 allowed). Consider refactoring.
    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',
    Severity: Major
    Found in src/Pelecard/PaymentRequest.php - About 4 hrs to fix

      Method __construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      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',
      Severity: Minor
      Found in src/Pelecard/PaymentRequest.php - About 1 hr to fix

        Function getMessage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        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;
            }
        Severity: Minor
        Found in src/Pelecard/PelecardPaymentStatus.php - About 1 hr to fix

        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

          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;
            }
        Severity: Minor
        Found in src/Pelecard/PelecardPaymentStatus.php - About 1 hr to fix

          Method __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            public function __construct($PelecardStatusCode, $PelecardTransactionId, $ParamX, $UserKey, $ConfirmationKey, $TotalX100, $ApprovalNo = '', $Token = '') {
          Severity: Major
          Found in src/Pelecard/PaymentResponse.php - About 1 hr to fix

            Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              function __construct($terminalNumber, $user, $password, $paramX, $shvaSuccessOnly = 'true') {
            Severity: Minor
            Found in src/Pelecard/CheckGoodParamX.php - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language