plugins/payment/classes/yf_payment_api__provider_bitaps.class.php

Summary

Maintainability
F
5 days
Test Coverage

File yf_payment_api__provider_bitaps.class.php has 632 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

_class('payment_api__provider_remote');

class yf_payment_api__provider_bitaps extends yf_payment_api__provider_remote
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 1 day to fix

    Function _external_response has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _external_response($options)
        {
            $operation_id = $options['operation_id'];
            $payment_code = $options['code'] ?: '';
            $address = $options['address'] ?: '';
    Severity: Minor
    Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 1 day 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 api_payout has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function api_payout($options = null)
        {
            if ( ! $this->ENABLE) {
                return  null;
            }
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 5 hrs to fix

      Method _external_response has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _external_response($options)
          {
              $operation_id = $options['operation_id'];
              $payment_code = $options['code'] ?: '';
              $address = $options['address'] ?: '';
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 3 hrs to fix

        Method deposition has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function deposition($options)
            {
                if ( ! $this->ENABLE) {
                    return  null;
                }
        Severity: Major
        Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 2 hrs to fix

          Function _check_operations has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _check_operations($type = 'payout')
              {
                  $payment_api = &$this->payment_api;
                  $successful_operations = [];
                  switch ($type) {
          Severity: Minor
          Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 2 hrs 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 _check_payout_operation has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _check_payout_operation($operation_id)
              {
                  $payment_api = &$this->payment_api;
                  $operation = $payment_api->operation(['operation_id' => $operation_id]);
                  $address = $operation['options']['request'][0]['options']['address'] ?: false;
          Severity: Minor
          Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 2 hrs 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 api_payout has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              public function api_payout($options = null)
              {
                  if ( ! $this->ENABLE) {
                      return  null;
                  }
          Severity: Minor
          Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 2 hrs 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 _check_payout_operation has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _check_payout_operation($operation_id)
              {
                  $payment_api = &$this->payment_api;
                  $operation = $payment_api->operation(['operation_id' => $operation_id]);
                  $address = $operation['options']['request'][0]['options']['address'] ?: false;
          Severity: Minor
          Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 1 hr to fix

            Method _api_response has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _api_response($options)
                {
                    $operation_id = isset($_GET['operation_id']) ? (int) ($_GET['operation_id']) : '';
                    $this->payment_api->dump(['name' => ucfirst($this->PROVIDER_NAME), 'operation_id' => $operation_id]);
                    // import options
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 1 hr to fix

              Method _check_operations has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _check_operations($type = 'payout')
                  {
                      $payment_api = &$this->payment_api;
                      $successful_operations = [];
                      switch ($type) {
              Severity: Minor
              Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ($real_payment_code == $payment_code && $confirmations >= $this->CONFIRMATIONS && $real_address == $address) {
                                            $need_update_amount = false;
                                            $request_amount_currency_satoshi = $operation['options']['request']['amount_currency_satoshi'];
                
                                            $request_fee = $operation['options']['request']['fee'];
                Severity: Major
                Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 45 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return  $result;
                  Severity: Major
                  Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return  $result;
                    Severity: Major
                    Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return  $result;
                      Severity: Major
                      Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return  $result;
                        Severity: Major
                        Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return  $result;
                          Severity: Major
                          Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return  $result;
                            Severity: Major
                            Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return  $result;
                              Severity: Major
                              Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 30 mins to fix

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

                                    public function deposition($options)
                                    {
                                        if ( ! $this->ENABLE) {
                                            return  null;
                                        }
                                Severity: Minor
                                Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.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

                                There are no issues that match your filters.

                                Category
                                Status