plugins/payment/modules/yf_payment_test.class.php

Summary

Maintainability
F
2 wks
Test Coverage

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

<?php

class yf_payment_test
{
    public $api = [
Severity: Major
Found in plugins/payment/modules/yf_payment_test.class.php - About 5 days to fix

    yf_payment_test has 61 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class yf_payment_test
    {
        public $api = [
            // 'Privat24'    => true,
            // 'LiqPay'      => true,
    Severity: Major
    Found in plugins/payment/modules/yf_payment_test.class.php - About 1 day to fix

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

          public function mail()
          {
              $mail_tpl = [
                  'payin_success' => [
                      'type' => 'payin',
      Severity: Major
      Found in plugins/payment/modules/yf_payment_test.class.php - About 4 hrs to fix

        Method _api_Interkassa has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _api_Interkassa($title)
            {
                $php = '';
                $api = _class('payment_api__provider_interkassa');
                $methods = [
        Severity: Major
        Found in plugins/payment/modules/yf_payment_test.class.php - About 3 hrs to fix

          Method currency_rates_current has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function currency_rates_current()
              {
                  $result = [];
                  $payment_api = _class('payment_api');
                  // conversion UNT to UAH
          Severity: Major
          Found in plugins/payment/modules/yf_payment_test.class.php - About 3 hrs to fix

            Method _payout_EcommPay has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _payout_EcommPay($title)
                {
                    $payment_api = _class('payment_api');
                    $provider_class = $payment_api->provider_class([
                        'provider_name' => 'ecommpay',
            Severity: Major
            Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

              Method _api_YandexMoney has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _api_YandexMoney($title)
                  {
                      $php = '';
                      $api = _class('payment_api__provider_yandexmoney');
                      $methods = [
              Severity: Major
              Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

                Method _add_panel has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function _add_panel($options)
                    {
                        static $count = 1;
                        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                        // action
                Severity: Major
                Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

                  Method _api_WebMoney has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function _api_WebMoney($title)
                      {
                          $php = '';
                          $api = _class('payment_api__provider_webmoney');
                          $methods = [
                  Severity: Major
                  Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

                    Method _currency_rate_load has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function _currency_rate_load($options = null)
                        {
                            // import options
                            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                            // var
                    Severity: Major
                    Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

                      Method _payout_YandexMoney has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function _payout_YandexMoney($title)
                          {
                              $payment_api = _class('payment_api');
                              $provider_class = $payment_api->provider_class([
                                  'provider_name' => 'yandexmoney',
                      Severity: Major
                      Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

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

                            protected function _payout_PerfectMoney($title)
                            {
                                $payment_api = _class('payment_api');
                                $provider_class = $payment_api->provider_class([
                                    'provider_name' => 'perfectmoney',
                        Severity: Major
                        Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

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

                              protected function _payout_WebMoney($title)
                              {
                                  $payment_api = _class('payment_api');
                                  $provider_class = $payment_api->provider_class([
                                      'provider_name' => 'webmoney',
                          Severity: Major
                          Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

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

                                protected function _payout_Interkassa($title)
                                {
                                    $payment_api = _class('payment_api');
                                    $provider_class = $payment_api->provider_class([
                                        'provider_name' => 'interkassa',
                            Severity: Major
                            Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

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

                                  protected function js_cors()
                                  {
                                      $api = _class('api');
                                      echo <<<'EOS'
                              <!DOCTYPE html>
                              Severity: Major
                              Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

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

                                    public function mail()
                                    {
                                        $mail_tpl = [
                                            'payin_success' => [
                                                'type' => 'payin',
                                Severity: Minor
                                Found in plugins/payment/modules/yf_payment_test.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 _api_PerfectMoney has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function _api_PerfectMoney($title)
                                    {
                                        $php = '';
                                        $api = _class('payment_api__provider_perfectmoney');
                                        $methods = [
                                Severity: Major
                                Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

                                  Method _render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function _render($result)
                                      {
                                          $asset_class = _class('assets');
                                          $asset_class->clean_all();
                                          $asset_class->ADD_IS_DIRECT_OUT = true;
                                  Severity: Minor
                                  Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

                                        protected function _sign_liqpay()
                                        {
                                            $form = '';
                                            $api = _class('payment_api__provider_liqpay');
                                            // test signature
                                    Severity: Minor
                                    Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

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

                                        Function _api_Interkassa has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            protected function _api_Interkassa($title)
                                            {
                                                $php = '';
                                                $api = _class('payment_api__provider_interkassa');
                                                $methods = [
                                        Severity: Minor
                                        Found in plugins/payment/modules/yf_payment_test.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 transaction has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function transaction()
                                            {
                                                $payment_api = _class('payment_api');
                                                // var
                                                $result = [];
                                        Severity: Minor
                                        Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

                                              protected function _payout_Privat24($title)
                                              {
                                                  return  (array) 'opss...';
                                                  $form = '';
                                                  $api = _class('payment_api__provider_privat24');
                                          Severity: Minor
                                          Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

                                                protected function _sign_interkassa()
                                                {
                                                    $form = '';
                                                    $api = _class('payment_api__provider_interkassa');
                                                    // test signature
                                            Severity: Minor
                                            Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

                                                  protected function _sign_PerfectMoney()
                                                  {
                                                      $form = '';
                                                      $api = _class('payment_api__provider_perfectmoney');
                                                      // test signature
                                              Severity: Minor
                                              Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

                                                Method payin has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    public function payin()
                                                    {
                                                        if ( ! empty($_POST)) {
                                                            $payment_api = _class('payment_api');
                                                            $dump = $payment_api->dump();
                                                Severity: Minor
                                                Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

                                                  Method _sign_privat24 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      protected function _sign_privat24()
                                                      {
                                                          $form = '';
                                                          $api = _class('payment_api__provider_privat24');
                                                          // test signature
                                                  Severity: Minor
                                                  Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

                                                    Method _sign_YandexMoney has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        protected function _sign_YandexMoney()
                                                        {
                                                            $form = '';
                                                            $api = _class('payment_api__provider_yandexmoney');
                                                            /*
                                                    Severity: Minor
                                                    Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

                                                      Method ip_check has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          protected function ip_check()
                                                          {
                                                              $api = _class('payment_api__provider_remote');
                                                              $api->ENABLE = true;
                                                              // $api = _class( 'api' );
                                                      Severity: Minor
                                                      Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

                                                            protected function _sign_webmoney()
                                                            {
                                                                $form = '';
                                                                $api = _class('payment_api__provider_webmoney');
                                                                // test signature
                                                        Severity: Minor
                                                        Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

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

                                                              protected function _add_panel($options)
                                                              {
                                                                  static $count = 1;
                                                                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                  // action
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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

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

                                                              protected function _api_YandexMoney($title)
                                                              {
                                                                  $php = '';
                                                                  $api = _class('payment_api__provider_yandexmoney');
                                                                  $methods = [
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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

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

                                                              protected function _currency_rate_load($options = null)
                                                              {
                                                                  // import options
                                                                  is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                  // var
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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 _api_WebMoney has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected function _api_WebMoney($title)
                                                              {
                                                                  $php = '';
                                                                  $api = _class('payment_api__provider_webmoney');
                                                                  $methods = [
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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 _payout_EcommPay has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected function _payout_EcommPay($title)
                                                              {
                                                                  $payment_api = _class('payment_api');
                                                                  $provider_class = $payment_api->provider_class([
                                                                      'provider_name' => 'ecommpay',
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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 _api_PerfectMoney has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected function _api_PerfectMoney($title)
                                                              {
                                                                  $php = '';
                                                                  $api = _class('payment_api__provider_perfectmoney');
                                                                  $methods = [
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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 _payout_PerfectMoney has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected function _payout_PerfectMoney($title)
                                                              {
                                                                  $payment_api = _class('payment_api');
                                                                  $provider_class = $payment_api->provider_class([
                                                                      'provider_name' => 'perfectmoney',
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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 _payout_WebMoney has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected function _payout_WebMoney($title)
                                                              {
                                                                  $payment_api = _class('payment_api');
                                                                  $provider_class = $payment_api->provider_class([
                                                                      'provider_name' => 'webmoney',
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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 _payout_Interkassa has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected function _payout_Interkassa($title)
                                                              {
                                                                  $payment_api = _class('payment_api');
                                                                  $provider_class = $payment_api->provider_class([
                                                                      'provider_name' => 'interkassa',
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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 _payout_YandexMoney has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected function _payout_YandexMoney($title)
                                                              {
                                                                  $payment_api = _class('payment_api');
                                                                  $provider_class = $payment_api->provider_class([
                                                                      'provider_name' => 'yandexmoney',
                                                          Severity: Minor
                                                          Found in plugins/payment/modules/yf_payment_test.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

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                  if (is_string($_submit) || is_string($action)) {
                                                                      $expanded = 'false';
                                                                      ! @$_is_action && $expanded_in = '';
                                                                      // form
                                                                      $form = '';
                                                          Severity: Major
                                                          Found in plugins/payment/modules/yf_payment_test.class.php - About 40 mins to fix

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

                                                                public function payin()
                                                                {
                                                                    if ( ! empty($_POST)) {
                                                                        $payment_api = _class('payment_api');
                                                                        $dump = $payment_api->dump();
                                                            Severity: Minor
                                                            Found in plugins/payment/modules/yf_payment_test.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 _currency_rates_load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                                protected function _currency_rates_load($options = null)
                                                                {
                                                                    // import options
                                                                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                                                    // var
                                                            Severity: Minor
                                                            Found in plugins/payment/modules/yf_payment_test.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 _chunk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                            Open

                                                                protected function _chunk($name, $title)
                                                                {
                                                                    if (is_array($title)) {
                                                                        $chunks = &$title;
                                                                        $result = [];
                                                            Severity: Minor
                                                            Found in plugins/payment/modules/yf_payment_test.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 currency_rates_load()
                                                                {
                                                                    // error_reporting(-1);
                                                                    $provider = [
                                                                        'NBU',
                                                            Severity: Minor
                                                            Found in plugins/payment/modules/yf_payment_test.class.php and 1 other location - About 50 mins to fix
                                                            plugins/payment/modules/yf_payment_test.class.php on lines 306..324

                                                            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 97.

                                                            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 currency_rate_load()
                                                                {
                                                                    // error_reporting(-1);
                                                                    $provider = [
                                                                        'NBU',
                                                            Severity: Minor
                                                            Found in plugins/payment/modules/yf_payment_test.class.php and 1 other location - About 50 mins to fix
                                                            plugins/payment/modules/yf_payment_test.class.php on lines 285..303

                                                            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 97.

                                                            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