Showing 3,246 of 4,217 total issues

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 load has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function load($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__currency.class.php - About 2 hrs to fix

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

          public function validate($validate_rules = [], $post = [], $extra = [])
          {
              $this->_validate_prepare($validate_rules, $extra);
      
              $func = function ($validate_rules, $post, $extra, $form) {
      Severity: Major
      Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs to fix

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

            public function _check_ip($ip, $ignore_ips = '', $check_type = 'force')
            {
                $masks = [
                    '0.0.0.0/8',        // Current network (only valid as source address)    RFC 1700
                    '10.0.0.0/8',        // Private network    RFC 1918
        Severity: Major
        Found in plugins/common/classes/common/yf_client_utils.class.php - About 2 hrs to fix

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

              public function order_product_add_ajax()
              {
                  if (empty($_POST['order_id']) || empty($_POST['product_id'])) {
                      return json_encode('ko');
                  }

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

                public function show()
                {
                    // Check if user exists
                    if (empty($this->_user_info)) {
                        return _e('No such user!');
            Severity: Major
            Found in plugins/user/modules/yf_user_profile.class.php - About 2 hrs to fix

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

                  public function _save_log($params = [])
                  {
                      if ( ! $this->LOG_REDIRECTS) {
                          return false;
                      }
              Severity: Major
              Found in plugins/logs/classes/logs/yf_logs_redirect.class.php - About 2 hrs to fix

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

                    public function _loop_detected($cur_url)
                    {
                        if ( ! $this->LOOP_DEFENCE) {
                            return false;
                        }
                Severity: Major
                Found in classes/yf_redirect.class.php - About 2 hrs to fix

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

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

                    Method _payout_status_handler has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _payout_status_handler($options = null)
                        {
                            if ( ! $this->ENABLE) {
                                return  null;
                            }

                      Method api_request has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method show has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function show()
                            {
                                $quick_filter = $this->_show_quick_filter();
                                return
                                    '<div class="col-md-12">' .
                        Severity: Major
                        Found in plugins/admin/admin_modules/yf_admin.class.php - About 2 hrs to fix

                          Method _init has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _init()
                              {
                                  $i_default = redis();
                                  $i_cache = strpos(strtolower(cache()->DRIVER), 'redis') !== false ? cache()->_driver->_connection : null;
                                  if (ini_get('session.save_handler') == 'redis' && preg_match('~tcp://(?P<host>[a-z0-9_-]+):(?P<port>[0-9]+)~ims', ini_get('session.save_path'), $m)) {
                          Severity: Major
                          Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 2 hrs to fix

                            Method test_10 has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function test_10()
                                {
                                    $this->assertEquals(
                                        '<div class="bb_remote_image"><img src="http://www.google.com/intl/en_ALL/images/logo.gif"></div>',
                                        self::_bbcode('[img]http://www.google.com/intl/en_ALL/images/logo.gif[/img]')
                            Severity: Major
                            Found in .dev/tests/unit/class_bb_codes_test.Test.php - About 2 hrs to fix

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

                                  public function vars()
                                  {
                                      $vars = $this->_get_all_vars_from_files();
                                      $vars_db = $this->_get_all_vars_from_db();
                                      foreach ((array) $vars_db as $source => $a) {
                              Severity: Minor
                              Found in plugins/locale/admin_modules/yf_locale_editor.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 a has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function a()
                                  {
                                      $args = func_get_args();
                                      $a = [];
                                      // numerics params
                              Severity: Minor
                              Found in plugins/html/classes/yf_html.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 _city_select has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function _city_select($params = [])
                                  {
                                      $STPL_NAME = 'register/city_select';
                                      if ( ! empty($params['stpl_name'])) {
                                          $STPL_NAME = $params['stpl_name'];
                              Severity: Minor
                              Found in plugins/geo/modules/yf_geo_content.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 validate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function validate($options)
                                  {
                                      // import options
                                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                                      // check payment method, type
                              Severity: Minor
                              Found in plugins/payment/classes/yf_payment_api__provider_remote.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 prepare has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

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

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

                              Severity
                              Category
                              Status
                              Source
                              Language