shetabit/multipay

View on GitHub

Showing 87 of 98 total issues

Consider simplifying this complex logical expression.
Open

    if (!isset($params['state']) ||
        !isset($params['status']) ||
        !isset($params['reservationNumber']) ||
        !isset($params['referenceNumber']) ||
        !isset($params['terminalId']) ||
Severity: Major
Found in src/Drivers/Atipay/Core/fn.atipay.php - About 40 mins to fix

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

        private function callCurl($url, $arrayData, $haveAuth = false, $try = 0, $method = 'POST')
    Severity: Minor
    Found in src/Drivers/Jibit/JibitClient.php - About 35 mins to fix

      Function purchase has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function purchase()
          {
              $details = $this->invoice->getDetails();
      
              $phone = null;
      Severity: Minor
      Found in src/Drivers/Idpay/Idpay.php - About 35 mins 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

      Function callCurl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private function callCurl($url, $arrayData, $haveAuth = false, $try = 0, $method = 'POST')
          {
              $data = $arrayData;
              $jsonData = json_encode($data);
              $accessToken = '';
      Severity: Minor
      Found in src/Drivers/Jibit/JibitClient.php - About 35 mins 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

      Function purchase has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function purchase()
          {
              $data = [
                  'api_key' => $this->settings->merchantId,
                  'order_id' => intval(1, time()) . crc32($this->invoice->getUuid()),
      Severity: Minor
      Found in src/Drivers/Nextpay/Nextpay.php - About 35 mins 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

      Function powMod has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function powMod($p, $q, $r)
          {
              $factors = array();
              $div = $q;
              $power_of_two = 0;
      Severity: Minor
      Found in src/Drivers/Pasargad/Utils/RSA.php - About 35 mins 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

      Avoid too many return statements within this method.
      Open

                  case -11: return "درگاه در انتظار تایید و یا غیرفعال است.";
      Severity: Major
      Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    case 1: return "پرداخت با موفقیت انجام شد.";
        Severity: Major
        Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return "شماره ترمینال ارسال شده یافت نشد";
          Severity: Major
          Found in src/Drivers/Atipay/Core/fn.atipay.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        case -6: return "کد پین وارد شده اشتباه است.";
            Severity: Major
            Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          case -10: return "مبلغ با مبلغ تراکنش مطابقت ندارد.";
              Severity: Major
              Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            case -9: return "کد پین درگاه با درگاه تراکنش مطابقت ندارد.";
                Severity: Major
                Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              case -7: return "کد تراکنش نمیتواند خالی باشد.";
                  Severity: Major
                  Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                case -13: return "شماره کارت باید 16 رقم چسبیده بهم باشد.";
                    Severity: Major
                    Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return "با این شماره ترمینال فقط تراکنش هاي توکنی قابل پرداخت هستند";
                      Severity: Major
                      Found in src/Drivers/Atipay/Core/fn.atipay.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    case 2: return "تراکنش قبلا وریفای شده است.";
                        Severity: Major
                        Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      case -5: return "مبلع باید بین 100 تومان تا 50 میلیون تومان باشد.";
                          Severity: Major
                          Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        case -12: return "امکان ارسال درخواست برای این پذیرنده وجود ندارد.";
                            Severity: Major
                            Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return "آدرس سرور پذیرنده نامعتبر است";
                              Severity: Major
                              Found in src/Drivers/Atipay/Core/fn.atipay.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return "خطای نامشخص در عملیات پرداخت";
                                Severity: Major
                                Found in src/Drivers/Atipay/Core/fn.atipay.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language