Showing 3,246 of 4,217 total issues

Method test_with_data has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function test_with_data()
    {
        $data = [
            [
                'date' => strtotime('2014-08-12 12:03:19 UTC'),
Severity: Minor
Found in .dev/tests/unit/functions/function_common_rss_page_test.php - About 1 hr to fix

    Method test_rewrite_disabled_simple has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function test_rewrite_disabled_simple()
        {
            $GLOBALS['PROJECT_CONF']['tpl']['REWRITE_MODE'] = false;
            unset($_GET['debug']);
            $this->assertEquals('http://' . self::$host . '/?object=test', process_url('./?object=test'));
    Severity: Minor
    Found in .dev/tests/rewrite/class_rewrite_testing_shared.php - About 1 hr to fix

      Function detect_content_type has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function detect_content_type($asset_type, $content = '')
          {
              $content = trim($content);
              $type = false;
              if (isset($this->assets[$content])) {
      Severity: Minor
      Found in plugins/assets/classes/yf_assets.class.php - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function show()
          {
              $all_vars = $this->_get_all_vars();
              $total_vars = count((array) $all_vars);
              $tr_vars = [];
      Severity: Minor
      Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 1 hr 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 time_box has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function time_box($selected = '', $name_postfix = '', $add_str = '', $show_text = 1, $translate = 1)
          {
              if (is_array($selected)) {
                  $extra = (array) $extra + $name;
                  $selected = $extra['selected'];
      Severity: Minor
      Found in plugins/html/classes/html/yf_html_datetime.class.php - About 1 hr 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 _update_user_geo_location has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _update_user_geo_location($user_id = 0, $FORCE_IP = '')
          {
              if ( ! main()->USE_GEO_IP) {
                  return false;
              }
      Severity: Minor
      Found in plugins/geo/classes/yf_geo_ip.class.php - About 1 hr 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 _operation has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _operation($options = null)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              // class
      Severity: Minor
      Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 1 hr 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 interkassa_detect_card has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function interkassa_detect_card($options = null)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              if (empty($_card)) {
      Severity: Minor
      Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr 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 _api_response has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _api_response()
          {
              if ( ! $this->ENABLE) {
                  return  null;
              }

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

          public function load__nbu($options = null)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              // var
      Severity: Minor
      Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 1 hr 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 _form_options has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _form_options($options)
          {
              if ( ! $this->ENABLE) {
                  return  null;
              }

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

          public function load_rate($options = null)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              // var
      Severity: Minor
      Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 1 hr 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 _api_Interkassa has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _api_Interkassa($title)
          {
              $php = '';
              $api = _class('payment_api__provider_interkassa');
              $methods = [
      Severity: Minor
      Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr 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 active has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function active($params = [])
          {
              if (is_string($params)) {
                  $params = [
                      'table' => $params,
      Severity: Minor
      Found in plugins/sys/classes/yf_admin_methods.class.php - About 1 hr 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 clone_item has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function clone_item($params = [])
          {
              if (is_string($params)) {
                  $params = [
                      'table' => $params,
      Severity: Minor
      Found in plugins/sys/classes/yf_admin_methods.class.php - About 1 hr 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_signal_init has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function _pcntl_signal_init($options = null)
          {
              if (is_console()) {
                  self::_pcntl_init($options);
                  $is_ttl = &self::$_pcntl_is_ttl;
      Severity: Minor
      Found in plugins/sys/classes/yf_pcntl_signal.class.php - About 1 hr 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 view_item has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function view_item()
          {
              if ( ! empty($_GET['id'])) {
                  $file_name = urldecode($_GET['id']);
                  $file_path = $file_name;
      Severity: Minor
      Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 1 hr 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_denied_tasks_names has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _get_denied_tasks_names()
          {
              $cache = 'cache_' . __FUNCTION__;
              if (isset($this->$cache)) {
                  return $this->$cache;
      Severity: Minor
      Found in plugins/sys/classes/yf_core_blocks.class.php - About 1 hr 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 add_item has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function add_item()
          {
              $menu_info = db()->get('SELECT * FROM ' . db('menus') . ' WHERE id=' . (int) ($_GET['id']));
              if (empty($menu_info['id'])) {
                  return _e('No such menu!');
      Severity: Minor
      Found in plugins/sys/admin_modules/yf_menus_editor.class.php - About 1 hr 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 _track_geo_location has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _track_geo_location()
          {
              if ( ! $this->TRACK_GEO_LOCATION || ! main()->USE_GEO_IP) {
                  return false;
              }
      Severity: Minor
      Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 1 hr 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