Showing 3,246 of 4,217 total issues

Function _searchd_running has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _searchd_running()
    {
        $pid_path = $this->LOG_PATH . 'searchd.pid';

        if (file_exists($pid_path)) {
Severity: Minor
Found in plugins/search/admin_modules/yf_manage_sphinx.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 _format_date has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _format_date($input_date = '', $type = 'short')
    {
        if ( ! strlen($input_date)) {
            return '';
        }
Severity: Minor
Found in classes/yf_utils.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 _validate_rules_array_from_raw has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _validate_rules_array_from_raw($raw = '')
    {
        $rules = [];
        // esxape '|' to '\|'
        $delimeter = '|';
Severity: Minor
Found in classes/yf_validate.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_lib_path has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function _get_lib_path($name, $params = []) {
        if (isset($this->php_libs[$name])) {
            return $this->php_libs[$name];
        }
        if (!isset($this->_paths_cache)) {
Severity: Minor
Found in services/_yf_autoloader.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 _check_location has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_location($cur_country = '', $cur_region = '', $cur_city = '')
    {
        // TODO: rewrite me
        if (FEATURED_COUNTRY_SELECT && ! empty($_POST['country']) && substr($_POST['country'], 0, 2) == 'f_') {
            $_POST['country'] = substr($_POST['country'], 2);
Severity: Minor
Found in classes/yf_validate.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_yf_console_commands has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function get_yf_console_commands()
{
    $cmds = [];
    $subfolder = 'commands/';
    $prefix_project = 'console_';
Severity: Minor
Found in .dev/console/yf.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 html_table_to_array has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    function html_table_to_array($html)
    {
        if ( ! preg_match_all('~<tr[^>]*>(.*?)</tr>~ims', $html, $m)) {
            return [];
        }
Severity: Minor
Found in .dev/scripts/scripts_utils.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 _fix_sql_php has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _fix_sql_php($sql_php)
    {
        $innodb_has_fulltext = self::_innodb_has_fulltext();
        if ( ! $innodb_has_fulltext) {
            // Remove fulltext indexes from db structure before creating table

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

    public function _fix_sql_php($sql_php)
    {
        $innodb_has_fulltext = self::_innodb_has_fulltext();
        if ( ! $innodb_has_fulltext) {
            // Remove fulltext indexes from db structure before creating table
Severity: Minor
Found in .dev/tests/functional/model/class_model_sakila_test.Test.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

Method a has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function a()
    {
        $args = func_get_args();
        $a = [];
        // numerics params
Severity: Minor
Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

    Method load__cashex_xml has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function load__cashex_xml($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

      Method _form_options has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method _api_response has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method active has 47 lines of code (exceeds 25 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

            Method _check_payout_operation has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _check_payout_operation($operation_id)
                {
                    $payment_api = &$this->payment_api;
                    $operation = $payment_api->operation(['operation_id' => $operation_id]);
                    $address = $operation['options']['request'][0]['options']['address'] ?: false;
            Severity: Minor
            Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 1 hr to fix

              Method _save_login_in_session has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _save_login_in_session($user_info = [], $no_redirect_on_success = false)
                  {
                      if (empty($user_info['id'])) {
                          return js_redirect($this->URL_WRONG_LOGIN);
                      } elseif ($this->_is_user_inactive($user_info)) {
              Severity: Minor
              Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 1 hr to fix

                Method save has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function save(array $params = [])
                    {
                        // Try to get user error message source
                        $backtrace = debug_backtrace();
                        $cur_trace = $backtrace[2];
                Severity: Minor
                Found in plugins/email/classes/mail/yf_mail_log.class.php - About 1 hr to fix

                  Method create_trigger has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function create_trigger($name, $table, $trigger_time, $trigger_event, $trigger_body, $extra = [], &$error = false)
                      {
                          if (strpos($name, '.') !== false) {
                              list($db_name, $name) = explode('.', trim($name));
                          }
                  Severity: Minor
                  Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 1 hr to fix

                    Method multi_get has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function multi_get($names = [], $force_ttl = 0, $params = [])
                        {
                            $do_real_work = true;
                            if ( ! $this->_driver_ok || $this->NO_CACHE) {
                                $do_real_work = false;
                    Severity: Minor
                    Found in plugins/cache/classes/yf_cache.class.php - About 1 hr to fix

                      Method footer_link has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function footer_link($name, $link, $extra = [])
                          {
                              $item = [
                                  'type' => __FUNCTION__,
                                  'name' => $name,
                      Severity: Minor
                      Found in plugins/table2/classes/yf_table2.class.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language