Showing 3,246 of 4,217 total issues

Method _create_cloud has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _create_cloud($cloud_data = [], $params = [])
    {
        if (empty($cloud_data)) {
            return '';
        }
Severity: Minor
Found in plugins/common/classes/common/yf_other_common.class.php - About 1 hr to fix

    Method feedback has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function feedback()
        {
            if (empty($_SESSION[$_GET['object'] . '__feedback'])) {
                $_SESSION[$_GET['object'] . '__feedback'] = [
                    'order_by' => 'add_date',

      Method checkout_images_revision has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function checkout_images_revision()
          {
              $_GET['id'] = (int) ($_GET['id']);
              $revision_data = db()->get('SELECT * FROM ' . db('shop_product_images_revisions') . ' WHERE id=' . $_GET['id']);
              if (empty($revision_data)) {

        Method basket_main has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function basket_main()
            {
                $products_ids = [];
                $basket_contents = module('shop')->_basket_api()->get_all();
                foreach ((array) $basket_contents as $_item_id => $_info) {
        Severity: Minor
        Found in plugins/shop/modules/shop/yf_shop_basket_main.class.php - About 1 hr to fix

          Method _api_upload has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _api_upload()
              {
                  $file = $_FILES['file'];
                  if (empty($file) || $file['error'] != UPLOAD_ERR_OK) {
                      $this->_reject('PHP: Entity Too Large', '500 Internal Server Error', 500);

            Method preview has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function preview($extra = [])
                {
                    conf('ROBOTS_NO_INDEX', true);
                    no_graphics(true);
                    if (main()->USER_ID != 1) {
            Severity: Minor
            Found in plugins/dynamic/modules/dynamic/yf_dynamic_preview.class.php - About 1 hr to fix

              Method _track_error has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _track_error($error_message = '')
                  {
                      if (empty($error_message)) {
                          return false;
                      }
              Severity: Minor
              Found in plugins/logs/classes/logs/yf_logs_user_error.class.php - About 1 hr to fix

                Method confirm has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function confirm()
                    {
                        // Send registration confirmation email
                        if ( ! $this->CONFIRM_REGISTER) {
                            return tpl()->parse('@object/confirm_messages', ['msg' => 'confirm_not_needed']);
                Severity: Minor
                Found in plugins/user/modules/yf_register.class.php - About 1 hr to fix

                  Method _show_form has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _show_form()
                      {
                          // Already logged in users not needed to login again
                          if (main()->USER_ID) {
                              return js_redirect($this->DEF_REDIRECT_URL);
                  Severity: Minor
                  Found in plugins/user/modules/yf_login_form.class.php - About 1 hr to fix

                    Method chart_flash has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function chart_flash($data, $params)
                        {
                            if (empty($data)) {
                                return;
                            }
                    Severity: Minor
                    Found in plugins/charts/classes/yf_charts.class.php - About 1 hr to fix

                      Method check has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function check($field_in_form = 'image_numbers', $input = null)
                          {
                              if ( ! $this->ENABLED) {
                                  return true;
                              }
                      Severity: Minor
                      Found in plugins/content/classes/yf_captcha.class.php - About 1 hr to fix

                        Method create_models_alternate_methods has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function create_models_alternate_methods()
                            {
                        try {
                                // Method 2
                                $bear_cool1 = model('bear')->create([
                        Severity: Minor
                        Found in .dev/tests/functional/model/class_model_bears_test.Test.php - About 1 hr to fix

                          Method test_has_many_through has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function test_has_many_through()
                              {
                                  $model_base = _class('model');
                                  $m = __FUNCTION__ . '_model';
                                  $t_countries = __FUNCTION__ . '_countries';
                          Severity: Minor
                          Found in .dev/tests/functional/model/class_model_basic_test.Test.php - About 1 hr to fix

                            Method test_order6 has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function test_order6()
                                {
                                    $jquery_url = _class('assets')->get_asset('jquery', 'js');
                                    $url = $jquery_url;
                                    $url1 = $url . '?v=1';
                            Severity: Minor
                            Found in .dev/tests/unit/class_assets_test.Test.php - About 1 hr to fix

                              Method test_simple has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function test_simple()
                                  {
                                      $this->assertEquals('', common()->_propose_url_from_name());
                                      $this->assertEquals('', common()->_propose_url_from_name(false));
                                      $this->assertEquals('', common()->_propose_url_from_name([]));

                                Method _attrs has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function _attrs($extra, $names)
                                    {
                                        $body = [];
                                        $a = [];
                                        foreach ((array) $names as $name) {
                                Severity: Minor
                                Found in functions/yf_common_funcs.php - About 1 hr to fix

                                  Function _get_daily_data has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function _get_daily_data($days = null)
                                      {
                                          $time = time();
                                          $days = $days ?: 60;
                                          $min_time = $time - $days * 86400;
                                  Severity: Minor
                                  Found in plugins/payment/admin_modules/yf_manage_deposit.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 _get_daily_data has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function _get_daily_data($days = null)
                                      {
                                          $time = time();
                                          $days = $days ?: 60;
                                          $min_time = $time - $days * 86400;
                                  Severity: Minor
                                  Found in plugins/payment/admin_modules/yf_manage_payment_operation.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 change_location_result has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function change_location_result()
                                      {
                                          if ( ! main()->USE_GEO_IP) {
                                              return false;
                                          }
                                  Severity: Minor
                                  Found in plugins/geo/modules/yf_geo_content.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 time_box2 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function time_box2($name, $selected = '', $add_str = '', $show_text = 1, $translate = 1)
                                      {
                                          if (is_array($selected)) {
                                              $extra = (array) $extra + $name;
                                              $name = $extra['name'];
                                  Severity: Minor
                                  Found in plugins/html/classes/html/yf_html_datetime.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language