Showing 4,217 of 4,217 total issues

Method _db_import has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _db_import($options, $test)
    {
        $_ = $options;
        $id = $_['id'];
        $fields = $_['fields'];

    yf_docs has 34 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class yf_docs
    {
        private $whats_new = [
            'demo',
        ];
    Severity: Minor
    Found in plugins/docs/modules/yf_docs.class.php - About 4 hrs to fix

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

      <?php
      
      /**
       * Templates handling class.
       *
      Severity: Minor
      Found in plugins/tpl/admin_modules/yf_template_editor.class.php - About 4 hrs to fix

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

                if (main()->is_post()) {
                    $tmp = [];
                    foreach (explode(',', $menu_info['custom_fields']) as $field_name) {
                        if ($field_name && $_POST['custom'][$field_name]) {
                            $tmp[$field_name] = $field_name . '=' . $_POST['custom'][$field_name];
        Severity: Major
        Found in plugins/sys/admin_modules/yf_menus_editor.class.php and 1 other location - About 4 hrs to fix
        plugins/sys/admin_modules/yf_menus_editor.class.php on lines 597..612

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

        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_type($options = null)
            {
                $_ = &$options;
                $object = $this->type($options);
                if (empty($object)) {
        Severity: Major
        Found in plugins/payment/classes/yf_payment_api.class.php and 1 other location - About 4 hrs to fix
        plugins/payment/classes/yf_payment_api.class.php on lines 730..750

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

        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

                if (main()->is_post()) {
                    $tmp = [];
                    foreach (explode(',', $menu_info['custom_fields']) as $field_name) {
                        if ($field_name && $_POST['custom'][$field_name]) {
                            $tmp[$field_name] = $field_name . '=' . $_POST['custom'][$field_name];
        Severity: Major
        Found in plugins/sys/admin_modules/yf_menus_editor.class.php and 1 other location - About 4 hrs to fix
        plugins/sys/admin_modules/yf_menus_editor.class.php on lines 651..666

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

        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

                    foreach ((array) $file_names as $location => $file_name) {
                        $file_text = file_get_contents($file_name);
                        // Try to get methods from parent classes (if exist one)
                        $_methods = $this->_recursive_get_methods_from_extends($file_text, ($location == 'admin_with_prefix' ? YF_ADMIN_CLS_PREFIX : '') . $user_module_name, $ONLY_PRIVATE_METHODS);
                        foreach ($_methods as $method_name) {
        plugins/admin/admin_modules/yf_admin_modules.class.php on lines 327..344

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

        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_status($options = null)
            {
                $_ = &$options;
                $payment_status = $this->status($options);
                if (empty($payment_status)) {
        Severity: Major
        Found in plugins/payment/classes/yf_payment_api.class.php and 1 other location - About 4 hrs to fix
        plugins/payment/classes/yf_payment_api.class.php on lines 666..686

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

        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

                    jquery('
                        $( "#slider-' . $extra['name'] . '" ).slider({
                            range: ' . $extra['range'] . ', 
                            min: ' . $extra['min'] . ',
                            max: ' . $extra['max'] . ',
        Severity: Major
        Found in plugins/form2/classes/form2/yf_form2_ui_range.class.php and 1 other location - About 4 hrs to fix
        plugins/form2/classes/form2/yf_form2_ui_range.class.php on lines 58..82

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

        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

                    foreach ((array) $file_names as $location => $file_name) {
                        $file_text = file_get_contents($file_name);
                        // Try to get methods from parent classes (if exist one)
                        $_methods = $this->_recursive_get_methods_from_extends($file_text, ($location == 'admin_with_prefix' ? YF_ADMIN_CLS_PREFIX : '') . $module_name, $ONLY_PRIVATE_METHODS);
                        foreach ($_methods as $method_name) {
        Severity: Major
        Found in plugins/admin/admin_modules/yf_admin_modules.class.php and 1 other location - About 4 hrs to fix
        plugins/sys/classes/core_api/yf_core_api_admin_modules.class.php on lines 212..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 169.

        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

                    $extra['feedback'] = '
                        $("input#' . $extra['name'] . '").on("change", function() {
                    //    $("input#' . $extra['name'] . '").on("keyup change", function() {
                            var value1 = $("input#' . $extra['name'] . '").val();
                            var value2 = $("input#' . $extra['name'] . '_and").val();
        Severity: Major
        Found in plugins/form2/classes/form2/yf_form2_ui_range.class.php and 1 other location - About 4 hrs to fix
        plugins/form2/classes/form2/yf_form2_ui_range.class.php on lines 121..142

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

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

            public function add($content, $asset_type = 'bundle', $content_type_hint = 'auto', $params = [])
            {
                if (DEBUG_MODE) {
                    $trace = main()->trace_string();
                }
        Severity: Major
        Found in plugins/assets/classes/yf_assets.class.php - About 4 hrs to fix

          Method mail has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function mail()
              {
                  $mail_tpl = [
                      'payin_success' => [
                          'type' => 'payin',
          Severity: Major
          Found in plugins/payment/modules/yf_payment_test.class.php - About 4 hrs to fix

            Method _show_menu has 107 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _show_menu($params = [])
                {
                    $return_array = isset($params['return_array']) ? $params['return_array'] : false;
                    $force_stpl_name = isset($params['force_stpl_name']) ? $params['force_stpl_name'] : false;
                    $menu_name = $params['name'];
            Severity: Major
            Found in plugins/sys/classes/yf_core_menu.class.php - About 4 hrs to fix

              Method init_graphics has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function init_graphics()
                  {
                      $init_type = MAIN_TYPE;
                      // Do not remove this!
                      $this->_init_global_tags();
              Severity: Major
              Found in plugins/tpl/classes/yf_tpl.class.php - About 4 hrs to fix

                Method _order_pay_authorize_net has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _order_pay_authorize_net($params = [])
                    {
                        $order_info = $params['order_info'];
                        $params = $params['params'];
                
                
                Severity: Major
                Found in plugins/shop/modules/shop/yf_shop__order_pay_authorize_net.class.php - About 4 hrs to fix

                  Function operation has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function operation($options = null)
                      {
                          $_ = &$options;
                          $is_no_count = &$_['no_count'];
                          $is_sql = &$_['sql'];
                  Severity: Minor
                  Found in plugins/payment/classes/yf_payment_api.class.php - About 4 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 _get_users_daily_payments has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _get_users_daily_payments($user_ids = [], $type = 'sum')
                      {
                          if ( ! $user_ids) {
                              return false;
                          }
                  Severity: Minor
                  Found in plugins/payment/admin_modules/yf_manage_payment.class.php - About 4 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 _pcntl_dispatch has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function _pcntl_dispatch($options = null)
                      {
                          $result = false;
                          // import options
                          is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                  Severity: Minor
                  Found in plugins/sys/classes/yf_pcntl_signal.class.php - About 4 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 from has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function from()
                      {
                          $sql = '';
                          $tables = func_get_args();
                          if ( ! count((array) $tables)) {
                  Severity: Minor
                  Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 4 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