Showing 3,246 of 4,217 total issues

Function multi_check_box has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function multi_check_box($name, $values = [], $selected = [], $horizontal = true, $type = 2, $add_str = '', $translate = 0, $name_as_array = false)
    {
        if (is_array($name)) {
            $extra = (array) $extra + $name;
            $name = $extra['name'];
Severity: Minor
Found in plugins/html/classes/yf_html.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 _do_login has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function _do_login()
    {
        $AUTH_LOGIN = trim($_POST[$this->LOGIN_FIELD]);
        $AUTH_PSWD = trim($_POST[$this->PSWD_FIELD]);

Severity: Minor
Found in plugins/auth/classes/auth/yf_auth_admin.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 _render_add_custom_fields has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function _render_add_custom_fields(&$params, &$data, &$ids)
    {
        if ( ! $data || ! $ids || ! $params['custom_fields']) {
            return false;
        }
Severity: Minor
Found in plugins/table2/classes/yf_table2.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 _currency_convert has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function _currency_convert($number = 0, $c_from = '', $c_to = '')
    {
        if ( ! $number || ! $c_from || ! $c_to) {
            return $number;
        }
Severity: Minor
Found in plugins/common/classes/common/yf_other_common.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 _store_item has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function _store_item($data = [])
    {
        if (is_string($data) && strlen($data)) {
            $data = ['url' => $data];
        }
Severity: Minor
Found in plugins/site_map/modules/yf_site_map.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

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

    public function show()
    {
        $object = &$this->object;
        $action = &$this->action;
        $filter_name = &$this->filter_name;
Severity: Major
Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 4 hrs to fix

    Method _show_for_object_tree has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _show_for_object_tree($params = [])
        {
            $OBJECT_NAME = ! empty($params['object_name']) ? $params['object_name'] : $_GET['object'];
            $OBJECT_ID = ! empty($params['object_id']) ? (int) ($params['object_id']) : (int) ($_GET['id']);
            $STPL_NAME_MAIN = ! empty($params['stpl_main']) ? $params['stpl_main'] : 'comments/main_tree';
    Severity: Major
    Found in plugins/comments/modules/yf_comments.class.php - About 4 hrs to fix

      Method conf has 114 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function conf($name = null, $new_value = null, $_arr_name = '')
          {
              $_arr_sub = null;
              if ( ! $_arr_name) {
                  $_arr_name = 'CONF';
      Severity: Major
      Found in functions/yf_conf.php - About 4 hrs to fix

        yf_db_migrator has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class yf_db_migrator
        {
            /**
             * Catch missing method call.
             * @param mixed $name
        Severity: Minor
        Found in plugins/db/classes/db/yf_db_migrator.class.php - About 4 hrs to fix

          Method _show_menu has 112 lines of code (exceeds 25 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: Major
          Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 4 hrs to fix

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

            <?php
            
            /**
             * Unicode methods.
             *
            Severity: Minor
            Found in classes/yf_utf8.class.php - About 4 hrs to fix

              Method _recreate has 111 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _recreate($options = null)
                  {
                      // import operation
                      is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                      // var
              Severity: Major
              Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 4 hrs to fix

                Method compact_info has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function compact_info()
                    {
                        main()->NO_GRAPHICS = true;
                        conf('no_ajax_here', true);
                        // Check user id
                Severity: Major
                Found in plugins/user/modules/yf_user_profile.class.php - About 4 hrs to fix

                  Function multi_select has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function multi_select($name, $values = [], $selected = '', $show_text = false, $type = 2, $add_str = '', $translate = 0, $level = 0, $disabled = false)
                      {
                          // Passing params as array
                          if (is_array($name)) {
                              $extra = (array) $extra + $name;
                  Severity: Minor
                  Found in plugins/html/classes/yf_html.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 show has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function show()
                      {
                          $a = $this->_get_page_from_db();
                          if ( ! $a) {
                              return _404();
                  Severity: Minor
                  Found in plugins/static_pages/modules/yf_static_pages.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 _show_for_object_tree has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _show_for_object_tree($params = [])
                      {
                          $OBJECT_NAME = ! empty($params['object_name']) ? $params['object_name'] : $_GET['object'];
                          $OBJECT_ID = ! empty($params['object_id']) ? (int) ($params['object_id']) : (int) ($_GET['id']);
                          $STPL_NAME_MAIN = ! empty($params['stpl_main']) ? $params['stpl_main'] : 'comments/main_tree';
                  Severity: Minor
                  Found in plugins/comments/modules/yf_comments.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 jquery_sparklines has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function jquery_sparklines($data, $extra = [])
                      {
                          $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
                          if ( ! is_array($data) || ! $data) {
                              return false;
                  Severity: Minor
                  Found in plugins/charts/classes/yf_charts.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 scan_dir has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function scan_dir($start_dir, $FLAT_MODE = true, $include_pattern = '', $exclude_pattern = '')
                  {
                      if ( ! file_exists($start_dir)) {
                          return false;
                      }
                  Severity: Minor
                  Found in .dev/useful/pack_zend.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

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

                      public function show($out_type, $params = [])
                      {
                          if ( ! $out_type || ! in_array($out_type, $this->supported_out_types)) {
                              throw new Exception('Assets: unsupported out content type: ' . $out_type);
                              return null;
                  Severity: Major
                  Found in plugins/assets/classes/yf_assets.class.php - About 4 hrs to fix

                    Method _init has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _init()
                        {
                            // class
                            $this->payment_api = _class('payment_api');
                            $this->manage_payment_lib = module('manage_payment_lib');
                    Severity: Major
                    Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language