shetabit/multipay

View on GitHub

Showing 87 of 98 total issues

Avoid too many return statements within this method.
Open

            case -8: return "تراکنش مورد نظر وجود ندارد.";
Severity: Major
Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                default: 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 0: 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

          Function generateToken has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private function generateToken($isForce = false)
              {
                  if ($isForce === false && $this->cache->has('accessToken')) {
                      return $this->setAccessToken($this->cache->get('accessToken'));
                  } elseif ($this->cache->has('refreshToken')) {
          Severity: Minor
          Found in src/Drivers/Jibit/JibitClient.php - About 25 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 fn_check_callback_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          function fn_check_callback_data($params)
          {
              $result = array();
              if (isset($params['state']) && !empty($params['state'])) {
                  $state = $params['state'];
          Severity: Minor
          Found in src/Drivers/Atipay/Core/fn.atipay.php - About 25 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 verify has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function verify(): ReceiptInterface
              {
                  $token = Request::get('token');
                  $paymentStatus = Request::get('payment_status');
                  $data = [
          Severity: Minor
          Found in src/Drivers/Vandar/Vandar.php - About 25 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

          Severity
          Category
          Status
          Source
          Language