Showing 4,217 of 4,217 total issues

Function delete has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete()
    {
        $i = preg_replace('~[^a-z0-9_]+~ims', '', trim($_GET['i']));
        if ( ! $i || ! isset($this->instances[$i])) {
            return js_redirect('/@object');
Severity: Minor
Found in plugins/redis/admin_modules/yf_manage_redis.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 api_payout has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

        public function _get_dashboard_data($id = '')
        {
            if ( ! $id) {
                $id = isset($params['name']) ? $params['name'] : ($this->_name ? $this->_name : $_GET['id']);
            }
    plugins/dashboards/admin_modules/yf_manage_dashboards2.class.php on lines 363..380

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

    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 _get_dashboard_data($id = '')
        {
            if ( ! $id) {
                $id = isset($params['name']) ? $params['name'] : ($this->_name ? $this->_name : $_GET['id']);
            }
    plugins/dashboards/admin_modules/yf_manage_dashboards.class.php on lines 480..497

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

    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_geo_content.class.php has 404 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    // Content display by geo location (ads, pages, etc)
    class yf_geo_content
    {
    Severity: Minor
    Found in plugins/geo/modules/yf_geo_content.class.php - About 5 hrs to fix

      Method _add has 142 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method _multi_request has 142 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _multi_request($urls, $options = [], $max_threads = 0, &$requests_info = [])
            {
                if ( ! $max_threads) {
                    $max_threads = $this->CURL_DEF_MAX_THREADS;
                }
        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

                  if (is_array($selected)) {
                      $extra = (array) $extra + $name;
                      $selected = $extra['selected'];
                      $values = isset($extra['values']) ? $extra['values'] : (array) $values; // Required
                      $selected = $extra['selected'];
          Severity: Major
          Found in plugins/html/classes/html/yf_html_datetime.class.php and 1 other location - About 5 hrs to fix
          plugins/html/classes/html/yf_html_datetime.class.php on lines 226..240

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

          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

                  if (is_array($selected)) {
                      $extra = (array) $extra + $name;
                      $name = $extra['name'];
                      $values = isset($extra['values']) ? $extra['values'] : (array) $values; // Required
                      $selected = $extra['selected'];
          Severity: Major
          Found in plugins/html/classes/html/yf_html_datetime.class.php and 1 other location - About 5 hrs to fix
          plugins/html/classes/html/yf_html_datetime.class.php on lines 101..115

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

          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_shop.class.php has 401 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Shop module.
           */
          Severity: Minor
          Found in plugins/shop/modules/yf_shop.class.php - About 5 hrs to fix

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

                public function tbl_link_edit($name = '', $link = '', $extra = [], $replace = [], $form)
                {
                    if (is_array($name)) {
                        $extra = (array) $extra + $name;
                        $name = $extra['name'];
            Severity: Major
            Found in plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php and 3 other locations - About 5 hrs to fix
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 111..128
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 138..155
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 165..182

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

            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 5 locations. Consider refactoring.
            Open

              4 => [
                'id' => '4',
                'group' => '2',
                'name' => '',
                'nick' => 'serega',
            Severity: Major
            Found in .dev/install/installer_data/db_tables_en/user.data.php and 4 other locations - About 5 hrs to fix
            .dev/install/installer_data/db_tables/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 44..83
            .dev/install/installer_data/db_tables_en/user.data.php on lines 84..123
            .dev/install/installer_data/db_tables_en/user.data.php on lines 124..163

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

            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 4 locations. Consider refactoring.
            Open

                public function tbl_link_delete($name = '', $link = '', $extra = [], $replace = [], $form)
                {
                    if (is_array($name)) {
                        $extra = (array) $extra + $name;
                        $name = $extra['name'];
            Severity: Major
            Found in plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php and 3 other locations - About 5 hrs to fix
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 84..101
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 138..155
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 165..182

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

            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 4 locations. Consider refactoring.
            Open

                public function tbl_link_view($name = '', $link = '', $extra = [], $replace = [], $form)
                {
                    if (is_array($name)) {
                        $extra = (array) $extra + $name;
                        $name = $extra['name'];
            Severity: Major
            Found in plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php and 3 other locations - About 5 hrs to fix
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 84..101
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 111..128
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 138..155

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

            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 5 locations. Consider refactoring.
            Open

              1 => [
                'id' => '1',
                'group' => '2',
                'name' => '',
                'nick' => 'test',
            Severity: Major
            Found in .dev/install/installer_data/db_tables/user.data.php and 4 other locations - About 5 hrs to fix
            .dev/install/installer_data/db_tables_en/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 44..83
            .dev/install/installer_data/db_tables_en/user.data.php on lines 84..123
            .dev/install/installer_data/db_tables_en/user.data.php on lines 124..163

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

            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 5 locations. Consider refactoring.
            Open

              7 => [
                'id' => '7',
                'group' => '2',
                'name' => '',
                'nick' => 'xchaotic',
            Severity: Major
            Found in .dev/install/installer_data/db_tables_en/user.data.php and 4 other locations - About 5 hrs to fix
            .dev/install/installer_data/db_tables/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 44..83
            .dev/install/installer_data/db_tables_en/user.data.php on lines 84..123

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

            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 5 locations. Consider refactoring.
            Open

              5 => [
                'id' => '5',
                'group' => '2',
                'name' => '',
                'nick' => 'oldman',
            Severity: Major
            Found in .dev/install/installer_data/db_tables_en/user.data.php and 4 other locations - About 5 hrs to fix
            .dev/install/installer_data/db_tables/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 84..123
            .dev/install/installer_data/db_tables_en/user.data.php on lines 124..163

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

            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 5 locations. Consider refactoring.
            Open

              6 => [
                'id' => '6',
                'group' => '2',
                'name' => '',
                'nick' => 'kingargyle',
            Severity: Major
            Found in .dev/install/installer_data/db_tables_en/user.data.php and 4 other locations - About 5 hrs to fix
            .dev/install/installer_data/db_tables/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 4..43
            .dev/install/installer_data/db_tables_en/user.data.php on lines 44..83
            .dev/install/installer_data/db_tables_en/user.data.php on lines 124..163

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

            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 4 locations. Consider refactoring.
            Open

                public function tbl_link_clone($name = '', $link = '', $extra = [], $replace = [], $form)
                {
                    if (is_array($name)) {
                        $extra = (array) $extra + $name;
                        $name = $extra['name'];
            Severity: Major
            Found in plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php and 3 other locations - About 5 hrs to fix
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 84..101
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 111..128
            plugins/form2/classes/form2/yf_form2_tbl_funcs.class.php on lines 165..182

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

            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

            Function _security_settings has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _security_settings()
                {
                    asset('bfh-select');
            
                    $user_id = main()->USER_ID;
            Severity: Minor
            Found in plugins/sys/admin_modules/yf_manage_security.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