Showing 4,217 of 4,217 total issues

Method _email_verify has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _email_verify($email = '', $check_mx = false, $check_by_smtp = false, $check_blacklists = false)
    {
        if (empty($email)) {
            return false;
        }
Severity: Major
Found in plugins/common/classes/common/yf_remote_files.class.php - About 5 hrs to fix

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

        public function init_css($force = false)
        {
            if ($this->_init_css_done && ! $force) {
                return false;
            }
    Severity: Major
    Found in plugins/assets/classes/yf_assets.class.php and 1 other location - About 5 hrs to fix
    plugins/assets/classes/yf_assets.class.php on lines 322..340

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

    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 init_js($force = false)
        {
            if ($this->_init_js_done && ! $force) {
                return false;
            }
    Severity: Major
    Found in plugins/assets/classes/yf_assets.class.php and 1 other location - About 5 hrs to fix
    plugins/assets/classes/yf_assets.class.php on lines 346..364

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

    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

    <?php
    
    return [
      1 => [
        'id' => '1',
    Severity: Major
    Found in .dev/install/installer_data/db_tables_en/news.data.php and 1 other location - About 5 hrs to fix
    .dev/install/installer_data/db_tables/sys_categories.data.php on lines 1..44

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

    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

    <?php
    
    return [
      1 => [
        'id' => '1',
    .dev/install/installer_data/db_tables_en/news.data.php on lines 1..229

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

    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

    Method _edit has 132 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _edit($params = [])
        {
            if (empty(main()->USER_ID) && MAIN_TYPE_USER) {
                return _error_need_login();
            }
    Severity: Major
    Found in plugins/comments/modules/comments/yf_comments_manage.class.php - About 5 hrs to fix

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

          public function _process_sub_patterns($text = '', $args = [])
          {
              if (false === strpos($text, '{') || ! is_array($args)) {
                  return $text;
              }
      Severity: Minor
      Found in plugins/locale/classes/yf_i18n.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_menu has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _show_menu($input = [])
          {
              $RETURN_ARRAY = isset($input['return_array']) ? $input['return_array'] : false;
              $force_stpl_name = isset($input['force_stpl_name']) ? $input['force_stpl_name'] : false;
              $menu_name = $input['name'];
      Severity: Minor
      Found in plugins/sys/admin_modules/yf_menus_editor.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 35 (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/sys/classes/core_api/yf_core_api_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 _prepare_cond_text has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _prepare_cond_text($cond = '', $replace = [], $stpl_name = '', $for_right = false)
          {
              $prepared_array = [];
              $cond = str_replace("\t", '', trim($cond));
              foreach (explode(' ', $cond) as $val) {
      Severity: Minor
      Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.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_replaces has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _process_replaces($string, array &$replace, $name = '')
          {
              if ( ! strlen($string) || false === strpos($string, '{')) {
                  return $string;
              }
      Severity: Minor
      Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.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 _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

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

        <?php
        
        return [
          1 => [
            'id' => '1',
        .dev/install/installer_data/db_tables_ru/mailarchive.data.php on lines 1..44

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

        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

        <?php
        
        return [
          4 => [
            'id' => '4',
        .dev/install/installer_data/db_tables_en/mailarchive.data.php on lines 1..43

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

        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

        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
            Severity
            Category
            Status
            Source
            Language