Showing 3,246 of 4,217 total issues

Function _correct_protocol has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function _correct_protocol($url)
    {
        if ( ! strlen($url)) {
            return false;
        }
Severity: Minor
Found in plugins/rewrite/classes/yf_rewrite.class.php - About 5 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 _data has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function _data()
    {
        $_sub_action = [
            '0' => '- не выбрано -',
            'add' => 'добавить',

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 _view_widget_items has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function _view_widget_items($name_ids = [], $items_configs = [])
    {
        $list_of_hooks = $this->_get_available_widgets_hooks();

        $_orig_object = $_GET['object'];
Severity: Minor
Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 5 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 substr has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function substr($text, $start, $length = null)
    {
        if ($this->MULTIBYTE == $this->UNICODE_MULTIBYTE) {
            return $length === null ? mb_substr($text, $start) : mb_substr($text, $start, $length);
        }
Severity: Minor
Found in classes/yf_utf8.class.php - About 5 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 _get_template_file has 131 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _get_template_file($file_name = '', $force_storage = '', $JUST_CHECK_IF_EXISTS = false, $RETURN_TEMPLATE_PATH = false)
    {
        $string = false;
        $NOT_FOUND = false;
        $storage = 'inline';
Severity: Major
Found in plugins/tpl/classes/yf_tpl.class.php - About 5 hrs to fix

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

    <?php
    
    /**
     * Framework template engine compile extension code.
     *
    Severity: Minor
    Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf_compile.class.php - About 5 hrs to fix

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

      <?php
      
      class yf_manage_redis
      {
          public $types = [
      Severity: Minor
      Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 5 hrs to fix

        yf_tpl has 39 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class yf_tpl
        {
            /** @var string @conf_skip Path to the templates (including current theme path) */
            public $TPL_PATH = '';
            /** @var string default template name */
        Severity: Minor
        Found in plugins/tpl/classes/yf_tpl.class.php - About 5 hrs to fix

          Method ui_range has 129 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function ui_range($name, $desc = '', $extra = [], $replace = [], $form)
              {
                  if (is_array($desc)) {
                      $extra += $desc;
                      $desc = '';
          Severity: Major
          Found in plugins/form2/classes/form2/yf_form2_ui_range.class.php - About 5 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

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

              <?php
              
              /**
               * Admin users manager.
               *
              Severity: Minor
              Found in plugins/admin/admin_modules/yf_admin.class.php - About 5 hrs to fix

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

                    public function show()
                    {
                        $i = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['i'])); // instance
                        $g = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['g'])); // group
                        $t = preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['t'])); // type
                Severity: Major
                Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 5 hrs to fix

                  Function api_payout has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function api_payout($options = null)
                      {
                          if ( ! $this->ENABLE) {
                              return  null;
                          }
                  Severity: Minor
                  Found in plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php - About 5 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 _recursive_get_methods_from_extends has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $_type = 'admin', $ONLY_PRIVATE_METHODS = false)
                      {
                          $extends_file_path = '';
                          $methods = [];
                          // TODO: connect plugins
                  Severity: Minor
                  Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 5 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 send has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function send($params = [])
                      {
                          $driver = strtolower($params['driver'] ?: $this->DRIVER);
                          if (DEBUG_MODE || $this->LOG_EMAILS) {
                              $time_start = microtime(true);
                  Severity: Minor
                  Found in plugins/email/classes/yf_send_mail.class.php - About 5 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 query has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function &query($sql)
                      {
                          if ( ! $this->_connected && ! $this->connect()) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/db/classes/yf_db.class.php - About 5 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 _set_curl_options has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _set_curl_options($url_options = [], $is_ftp_url = false)
                      {
                          $curl_opts = [];
                  
                          $user_agent = isset($url_options['user_agent']) ? $url_options['user_agent'] : $this->DEF_USER_AGENT;
                  Severity: Minor
                  Found in plugins/common/classes/common/yf_remote_files.class.php - About 5 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 show has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function show()
                      {
                          conf('_login_form_displayed', true);
                          if ( ! empty($_POST)) {
                              if (empty($_POST['login']) && empty($_POST['email'])) {
                  Severity: Minor
                  Found in plugins/user/modules/yf_get_pswd.class.php - About 5 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 compact_info has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function compact_info()
                      {
                          main()->NO_GRAPHICS = true;
                          conf('no_ajax_here', true);
                          // Check user id
                  Severity: Minor
                  Found in plugins/user/modules/yf_user_profile.class.php - About 5 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 _process_text has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _process_text($body = '', $no_smilies = false, $smilies_as_image = false)
                      {
                          if (empty($body)) {
                              return '';
                          }
                  Severity: Minor
                  Found in plugins/content/classes/yf_bb_codes.class.php - About 5 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