Showing 4,217 of 4,217 total issues

Function auto has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    public function auto($table = '', $id = '', $params = [], $form)
    {
        if ($params['links_add']) {
            $form->_params['links_add'] = $params['links_add'];
        }
Severity: Minor
Found in plugins/form2/classes/form2/yf_form2_auto.class.php - About 1 day 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 _upload_item__import_test has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _upload_item__import_test($options)
    {
        // load import data
        $_ = $options;
        $id = $_['id'];

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

    public function _get_methods($params = [])
    {
        $ONLY_PRIVATE_METHODS = [];
        if (isset($params['private'])) {
            $ONLY_PRIVATE_METHODS = $params['private'];
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 1 day 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

class_db_offline_query_builder_test has 58 functions (exceeds 20 allowed). Consider refactoring.
Open

class class_db_offline_query_builder_test extends db_offline_abstract
{
    public function test_select_star()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
Severity: Major
Found in .dev/tests/unit/db/class_db_offline_query_builder_test.Test.php - About 1 day to fix

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

            foreach ((array) $_widgets as $module_name => $module_widgets) {
                foreach ((array) $module_widgets as $method_name => $full_name) {
                    $auto_id = str_replace(array_keys($r), array_values($r), $full_name);
                    $widgets[$auto_id] = module_safe($module_name)->$method_name(['describe_self' => true]);
                    if ( ! $widgets[$auto_id]['name']) {
    Severity: Major
    Found in plugins/common/classes/common/yf_dashboards.class.php and 1 other location - About 1 day to fix
    plugins/dashboards/admin_modules/yf_manage_dashboards.class.php on lines 543..560

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

    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

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

            foreach ((array) $_widgets as $module_name => $module_widgets) {
                foreach ((array) $module_widgets as $method_name => $full_name) {
                    $auto_id = str_replace(array_keys($r), array_values($r), $full_name);
                    $widgets[$auto_id] = module_safe($module_name)->$method_name(['describe_self' => true]);
                    if ( ! $widgets[$auto_id]['name']) {
    plugins/common/classes/common/yf_dashboards.class.php on lines 260..277

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

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

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

        public function _validate_rules_process($validate_rules = [], &$data)
        {
            $validate_ok = true;
            foreach ((array) $validate_rules as $name => $rules) {
                $is_required = false;
    Severity: Minor
    Found in plugins/form2/classes/yf_form2.class.php - About 1 day 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 _request has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _request($url, $post = null, $options = null)
        {
            // import options
            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
            // options
    Severity: Minor
    Found in plugins/api/classes/yf_api.class.php - About 1 day 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 ajax_validate has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

        public function ajax_validate()
        {
            no_graphics(true);
            header('X-Robots-Tag: noindex, nofollow, noarchive, nosnippet');
    
    
    Severity: Minor
    Found in plugins/dynamic/modules/dynamic/yf_dynamic_validate.class.php - About 1 day 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

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

    <?php
    
    /***
     *  module: api
     *
    Severity: Major
    Found in plugins/api/classes/yf_api.class.php - About 1 day to fix

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

          public function test_view_exists()
          {
              if ($this->_need_skip_test(__FUNCTION__)) {
                  return;
              }
      .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 867..880
      .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 897..910

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

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

          public function test_create_view()
          {
              if ($this->_need_skip_test(__FUNCTION__)) {
                  return;
              }
      .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 853..866
      .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 867..880

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

      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 _show_quick_filter()
          {
              $a = [];
              $status_names = from('payment_status')->get_2d('status_id, title');
              $count_by_status = select(['status_id', 'COUNT(*) AS num'])->from('payment_operation')
      Severity: Major
      Found in plugins/payment/admin_modules/yf_manage_deposit.class.php and 1 other location - About 1 day to fix
      plugins/payment/admin_modules/yf_manage_payout.class.php on lines 287..310

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

      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 _show_quick_filter()
          {
              $a = [];
              $status_names = from('payment_status')->get_2d('status_id, title');
              $count_by_status = select(['status_id', 'COUNT(*) AS num'])->from('payment_operation')
      Severity: Major
      Found in plugins/payment/admin_modules/yf_manage_payout.class.php and 1 other location - About 1 day to fix
      plugins/payment/admin_modules/yf_manage_deposit.class.php on lines 235..258

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

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

          public function test_view_info()
          {
              if ($this->_need_skip_test(__FUNCTION__)) {
                  return;
              }
      .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 853..866
      .dev/tests/functional/db/class_db_real_utils_mysql_test.Test.php on lines 897..910

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

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

          public function _operation($options = null)
          {
              // var
              $is_valid = true;
              $is_options = true;
      Severity: Major
      Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 day to fix

        Function generate_up has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
        Open

            public function generate_up($params = [])
            {
                if ( ! isset($report)) {
                    $report = $this->compare($params);
                }
        Severity: Minor
        Found in plugins/db/classes/db/yf_db_migrator.class.php - About 1 day 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 has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _process($params = [])
            {
                // THESE ARE REQUIRED!
                $SOURCE_ARRAY = $params['source_array'];
                $TABLE_NAME = $params['table_name'];
        Severity: Minor
        Found in plugins/common/classes/common/yf_related_content.class.php - About 1 day 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 _generate_sitemap has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _generate_sitemap()
            {
                main()->NO_GRAPHICS = true;
                if ( ! $this->SITE_MAP_ENABLED) {
                    return false;
        Severity: Minor
        Found in plugins/site_map/modules/yf_site_map.class.php - About 1 day 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