plugins/payment/classes/yf_payment_api.class.php

Summary

Maintainability
F
2 wks
Test Coverage

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

<?php

if ( ! function_exists('array_replace_recursive')) {
    trigger_error('Not exists function "array_replace_recursive ( PHP 5 >= 5.3.0 )"', E_USER_ERROR);
}
Severity: Major
Found in plugins/payment/classes/yf_payment_api.class.php - About 5 days to fix

    yf_payment_api has 85 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class yf_payment_api
    {
        public $user_id_default = null;
        public $user_id = null;
    
    
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api.class.php - About 1 day to fix

      Method _operation_check has 156 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _operation_check($options = null)
          {
              $result = [];
              $data = [];
              // options
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api.class.php - About 6 hrs to fix

        Method mail has 128 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function mail($options = null)
            {
                // DEBUG
                // ini_set( 'html_errors', 0 );
                // var_dump( $options );
        Severity: Major
        Found in plugins/payment/classes/yf_payment_api.class.php - About 5 hrs to fix

          Function operation has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function operation($options = null)
              {
                  $_ = &$options;
                  $is_no_count = &$_['no_count'];
                  $is_sql = &$_['sql'];
          Severity: Minor
          Found in plugins/payment/classes/yf_payment_api.class.php - About 4 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 transfer has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function transfer($options = null)
              {
                  $_ = &$options;
                  $is_transaction = isset( $_['is_transaction'] ) ? $_['is_transaction'] : true;
                  // check: from, to
          Severity: Major
          Found in plugins/payment/classes/yf_payment_api.class.php - About 3 hrs to fix

            Method cancel has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function cancel($options = null)
                {
                    // import options
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                    // var
            Severity: Major
            Found in plugins/payment/classes/yf_payment_api.class.php - About 3 hrs to fix

              Function mail has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function mail($options = null)
                  {
                      // DEBUG
                      // ini_set( 'html_errors', 0 );
                      // var_dump( $options );
              Severity: Minor
              Found in plugins/payment/classes/yf_payment_api.class.php - About 3 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 provider has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function provider($options = null)
                  {
                      // import options
                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                      // get providers
              Severity: Minor
              Found in plugins/payment/classes/yf_payment_api.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 _operation_check has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _operation_check($options = null)
                  {
                      $result = [];
                      $data = [];
                      // options
              Severity: Minor
              Found in plugins/payment/classes/yf_payment_api.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 operation has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function operation($options = null)
                  {
                      $_ = &$options;
                      $is_no_count = &$_['no_count'];
                      $is_sql = &$_['sql'];
              Severity: Major
              Found in plugins/payment/classes/yf_payment_api.class.php - About 2 hrs to fix

                Method confirmation_code_check has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function confirmation_code_check($options = null)
                    {
                        // import options
                        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                        // operation
                Severity: Major
                Found in plugins/payment/classes/yf_payment_api.class.php - About 2 hrs to fix

                  Method provider has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function provider($options = null)
                      {
                          // import options
                          is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                          // get providers
                  Severity: Major
                  Found in plugins/payment/classes/yf_payment_api.class.php - About 2 hrs to fix

                    Function cancel has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function cancel($options = null)
                        {
                            // import options
                            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                            // var
                    Severity: Minor
                    Found in plugins/payment/classes/yf_payment_api.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 _object_update has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function _object_update($name, $data, $options = null)
                        {
                            if (empty($name)) {
                                return  null;
                            }
                    Severity: Minor
                    Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                      Method account has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function account($options = null)
                          {
                              // by account_id
                              $result = $this->get_account__by_id($options);
                              if ( ! empty($result)) {
                      Severity: Minor
                      Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                        Function mail_copy_find has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function mail_copy_find(&$mails, $options = null)
                            {
                                if (empty($this->MAIL_COPY_TO)) {
                                    return;
                                }
                        Severity: Minor
                        Found in plugins/payment/classes/yf_payment_api.class.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 confirmation_ok has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function confirmation_ok($options = null)
                            {
                                // import options
                                is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                // operation
                        Severity: Minor
                        Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                          Method payment has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function payment($options = null)
                              {
                                  $_ = &$options;
                                  $is_transaction = isset( $_['is_transaction'] ) ? $_['is_transaction'] : true;
                                  $_['type_name'] = __FUNCTION__;
                          Severity: Minor
                          Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                            Method _operation_balance_update has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _operation_balance_update($options = null)
                                {
                                    // import options
                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                    // operation
                            Severity: Minor
                            Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                              Method confirmation has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function confirmation(&$options = null, &$data = null, &$operation_data = null)
                                  {
                                      $status = true;
                                      $result = [
                                          'status' => &$status,
                              Severity: Minor
                              Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if (@$_['user_mode'] && (
                                            ($type['name'] == 'payment' && $_['is_balance_limit_lower'] && ($balance - $amount < $balance_limit_lower))
                                            || ($type['name'] == 'transfer' && $direction === 'out' && $_['is_balance_limit_lower'] && ($balance - $amount < $balance_limit_lower))
                                        )) {
                                            $result = [
                                Severity: Critical
                                Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                  Method account_create has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function account_create($options = null)
                                      {
                                          // options
                                          $_ = &$options;
                                          $data = [];
                                  Severity: Minor
                                  Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

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

                                        public function deposition($options = null)
                                        {
                                            $_ = &$options;
                                            $_['type_name'] = __FUNCTION__;
                                            $_['operation_title'] = $_['operation_title'] ?: 'Пополнение счета';
                                    Severity: Minor
                                    Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                      Method money_format has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function money_format($options = null)
                                          {
                                              // import options
                                              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                              // currency
                                      Severity: Minor
                                      Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                        Method dump has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function dump($options = null)
                                            {
                                                static $is_first = true;
                                                // import options
                                                is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                        Severity: Minor
                                        Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                          Method status has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              public function status($options = null)
                                              {
                                                  // get status
                                                  $status = $this->status;
                                                  $status_index = $this->status_index;
                                          Severity: Minor
                                          Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                            Function transaction_start has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public function transaction_start($options = null)
                                                {
                                                    // import options
                                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                    $tx = &$this->transaction;
                                            Severity: Minor
                                            Found in plugins/payment/classes/yf_payment_api.class.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 mail_copy has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                public function mail_copy($options = null)
                                                {
                                                    // import options
                                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                    if (empty($_tpl) || empty($_data)) {
                                            Severity: Minor
                                            Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                              Method is_user_mail has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  public function is_user_mail($options = null)
                                                  {
                                                      // import options
                                                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                      // var
                                              Severity: Minor
                                              Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                                Function transfer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    public function transfer($options = null)
                                                    {
                                                        $_ = &$options;
                                                        $is_transaction = isset( $_['is_transaction'] ) ? $_['is_transaction'] : true;
                                                        // check: from, to
                                                Severity: Minor
                                                Found in plugins/payment/classes/yf_payment_api.class.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 type has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    public function type($options = null)
                                                    {
                                                        // get type
                                                        $type = $this->type;
                                                        $type_index = $this->type_index;
                                                Severity: Minor
                                                Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                                  Method get_account__by_id has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      public function get_account__by_id($options = null)
                                                      {
                                                          $account = &$this->account;
                                                          $account_id = $this->account_id;
                                                          // cache
                                                  Severity: Minor
                                                  Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                                    Method _cancel has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        public function _cancel($options = null)
                                                        {
                                                            // import options
                                                            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                            // var
                                                    Severity: Minor
                                                    Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                                                      Function status has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          public function status($options = null)
                                                          {
                                                              // get status
                                                              $status = $this->status;
                                                              $status_index = $this->status_index;
                                                      Severity: Minor
                                                      Found in plugins/payment/classes/yf_payment_api.class.php - About 55 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 provider_options has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          public function provider_options(&$provider, $options = null)
                                                          {
                                                              if ( ! isset($options) || ! is_array($provider)) {
                                                                  return  false;
                                                              }
                                                      Severity: Minor
                                                      Found in plugins/payment/classes/yf_payment_api.class.php - About 45 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 config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          public function config($options = null)
                                                          {
                                                              ! empty($options) && $this->CONFIG = $options;
                                                              $config = &$this->CONFIG;
                                                              if (is_array($config)) {
                                                      Severity: Minor
                                                      Found in plugins/payment/classes/yf_payment_api.class.php - About 45 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

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

                                                          public function _number_api($float = 0, $decimals = null, $decimal_point = null, $thousands_separator = '', $decimal_point_force = null)
                                                      Severity: Minor
                                                      Found in plugins/payment/classes/yf_payment_api.class.php - About 35 mins to fix

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

                                                            public function _number_float($float = 0, $decimals = null, $decimal_point = null, $thousands_separator = '', $decimal_point_force = null)
                                                        Severity: Minor
                                                        Found in plugins/payment/classes/yf_payment_api.class.php - About 35 mins to fix

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

                                                              public function _number_mysql($float = 0, $decimals = null, $decimal_point = null, $thousands_separator = '', $decimal_point_force = null)
                                                          Severity: Minor
                                                          Found in plugins/payment/classes/yf_payment_api.class.php - About 35 mins to fix

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

                                                                public function _number_format($float = 0, $decimals = null, $decimal_point = null, $thousands_separator = null, $decimal_point_force = null)
                                                            Severity: Minor
                                                            Found in plugins/payment/classes/yf_payment_api.class.php - About 35 mins to fix

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

                                                                  public function account($options = null)
                                                                  {
                                                                      // by account_id
                                                                      $result = $this->get_account__by_id($options);
                                                                      if ( ! empty($result)) {
                                                              Severity: Minor
                                                              Found in plugins/payment/classes/yf_payment_api.class.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 mail_copy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  public function mail_copy($options = null)
                                                                  {
                                                                      // import options
                                                                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                      if (empty($_tpl) || empty($_data)) {
                                                              Severity: Minor
                                                              Found in plugins/payment/classes/yf_payment_api.class.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 confirmation_code_check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  public function confirmation_code_check($options = null)
                                                                  {
                                                                      // import options
                                                                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                      // operation
                                                              Severity: Minor
                                                              Found in plugins/payment/classes/yf_payment_api.class.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 type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  public function type($options = null)
                                                                  {
                                                                      // get type
                                                                      $type = $this->type;
                                                                      $type_index = $this->type_index;
                                                              Severity: Minor
                                                              Found in plugins/payment/classes/yf_payment_api.class.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 _operation_fetch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  public function _operation_fetch($options = null)
                                                                  {
                                                                      // import options
                                                                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                      if (is_array($_data)) {
                                                              Severity: Minor
                                                              Found in plugins/payment/classes/yf_payment_api.class.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

                                                                          return  $result;
                                                              Severity: Major
                                                              Found in plugins/payment/classes/yf_payment_api.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.class.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                          return  [true, $result, $data];
                                                                  Severity: Major
                                                                  Found in plugins/payment/classes/yf_payment_api.class.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                            return  [$result, $count];
                                                                    Severity: Major
                                                                    Found in plugins/payment/classes/yf_payment_api.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.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.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.class.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                    return  [$account_id, $account];
                                                                            Severity: Major
                                                                            Found in plugins/payment/classes/yf_payment_api.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.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.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.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.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.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.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.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.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.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.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.class.php - About 30 mins to fix

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                                return  $object;
                                                                                                    Severity: Major
                                                                                                    Found in plugins/payment/classes/yf_payment_api.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.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.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.class.php - About 30 mins to fix

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

                                                                                                                public function transaction_isolation($options = null)
                                                                                                                {
                                                                                                                    // import options
                                                                                                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                                                                    // var
                                                                                                            Severity: Minor
                                                                                                            Found in plugins/payment/classes/yf_payment_api.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

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

                                                                                                                public function _cancel($options = null)
                                                                                                                {
                                                                                                                    // import options
                                                                                                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                                                                    // var
                                                                                                            Severity: Minor
                                                                                                            Found in plugins/payment/classes/yf_payment_api.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

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

                                                                                                                public function confirmation(&$options = null, &$data = null, &$operation_data = null)
                                                                                                                {
                                                                                                                    $status = true;
                                                                                                                    $result = [
                                                                                                                        'status' => &$status,
                                                                                                            Severity: Minor
                                                                                                            Found in plugins/payment/classes/yf_payment_api.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

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

                                                                                                                public function _operation_balance_update($options = null)
                                                                                                                {
                                                                                                                    // import options
                                                                                                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                                                                    // operation
                                                                                                            Severity: Minor
                                                                                                            Found in plugins/payment/classes/yf_payment_api.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

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

                                                                                                                public function transaction_finish($options = null)
                                                                                                                {
                                                                                                                    // import options
                                                                                                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                                                                    $tx = &$this->transaction;
                                                                                                            Severity: Minor
                                                                                                            Found in plugins/payment/classes/yf_payment_api.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

                                                                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                            Open

                                                                                                                public function get_type($options = null)
                                                                                                                {
                                                                                                                    $_ = &$options;
                                                                                                                    $object = $this->type($options);
                                                                                                                    if (empty($object)) {
                                                                                                            Severity: Major
                                                                                                            Found in plugins/payment/classes/yf_payment_api.class.php and 1 other location - About 4 hrs to fix
                                                                                                            plugins/payment/classes/yf_payment_api.class.php on lines 730..750

                                                                                                            Duplicated Code

                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                            Tuning

                                                                                                            This issue has a mass of 169.

                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                            Refactorings

                                                                                                            Further Reading

                                                                                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                            Open

                                                                                                                public function get_status($options = null)
                                                                                                                {
                                                                                                                    $_ = &$options;
                                                                                                                    $payment_status = $this->status($options);
                                                                                                                    if (empty($payment_status)) {
                                                                                                            Severity: Major
                                                                                                            Found in plugins/payment/classes/yf_payment_api.class.php and 1 other location - About 4 hrs to fix
                                                                                                            plugins/payment/classes/yf_payment_api.class.php on lines 666..686

                                                                                                            Duplicated Code

                                                                                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                            Tuning

                                                                                                            This issue has a mass of 169.

                                                                                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                            Refactorings

                                                                                                            Further Reading

                                                                                                            There are no issues that match your filters.

                                                                                                            Category
                                                                                                            Status