Showing 3,246 of 4,217 total issues

Function _send_email_safe has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function _send_email_safe($email_to, $name_to, $template_name, $data = [], $old_param1 = null, $override = [])
    {
        $is_test = (defined('TEST_MODE') && TEST_MODE)
            && empty($override['force_send'])
            && empty($this->FORCE_SEND);
Severity: Minor
Found in plugins/email/classes/yf_email.class.php - About 2 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 _send_email_to_user has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function _send_email_to_user($user_id, $template_name, $data = [], $instant_send = true, $require_verified_email = false, $is_wall_update = true, $template_group = '')
    {
        $instant_send = false;
        $user_data = db()->from('user')->whereid($user_id)->get();
        if (empty($user_data)) {
Severity: Minor
Found in plugins/email/classes/yf_email.class.php - About 2 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 view has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function view()
    {
        $id = (int) $_GET['id'];
        if ($id) {
            $a = db()->from(self::table)->whereid($id)->get();
Severity: Minor
Found in plugins/db/admin_modules/yf_manage_revisions.class.php - About 2 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 _send_copies has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function _send_copies($params = [])
    {
        if ( ! $params) {
            return false;
        }
Severity: Minor
Found in plugins/email/classes/yf_email.class.php - About 2 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 _load_tables_sql_php_from_files has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function _load_tables_sql_php_from_files($params = [])
    {
        $existing_files_sql_php = [];
        $existing_sql_php = [];
        // Preload db installer PHP array of CREATE TABLE DDL statements
Severity: Minor
Found in plugins/db/classes/db/yf_db_migrator.class.php - About 2 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_table_td has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function _render_table_td($info, $row, $params, $row_id)
    {
        $name = $info['name'];
        if ( ! array_key_exists($name, $row)) {
            return false;
Severity: Minor
Found in plugins/table2/classes/yf_table2.class.php - About 2 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 add_get_vars has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function add_get_vars($add_skip = [])
    {
        // Cache it
        if (isset($this->_get_vars_cache)) {
            return $this->_get_vars_cache;
Severity: Minor
Found in plugins/common/classes/yf_common.class.php - About 2 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 edit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit()
    {
        if (is_post() && isset($_POST['mass_delete']) && $_POST['id']) {
            $_GET['action'] = 'delete';
            return $this->delete();
Severity: Minor
Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 2 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 exec has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function exec($server_info = [], $cmd = '')
    {
        if ( ! $this->_INIT_OK || ! $cmd || ! $server_info) {
            return false;
        }
Severity: Minor
Found in plugins/ssh/classes/yf_ssh.class.php - About 2 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 move_dir has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function move_dir($path1, $path2, $pattern_include = '', $pattern_exclude = '')
    {
        if ( ! $path1 || ! file_exists($path1)) {
            return false;
        }
Severity: Minor
Found in classes/yf_dir.class.php - About 2 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 _debug_DEBUG_YF has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_DEBUG_YF(&$params = [])
    {
        if ( ! $this->SHOW_SETTINGS) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 2 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 _account_info has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function _account_info($account_id)
    {
        $cached_account_info = &main()->_cached_account_info;
        if (is_numeric($account_id)) {
            $account_id = (int) $account_id;
Severity: Minor
Found in classes/yf_utils.class.php - About 2 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 execute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        global $yf_paths;
        require_once $yf_paths['db_setup_path'];
        init_yf();
Severity: Minor
Found in .dev/console/commands/yf_console_db_utils.class.php - About 2 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 require_php_lib has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function require_php_lib($name, $params = [])
    {
        if (isset($this->php_libs[$name])) {
            return $this->php_libs[$name];
        }
Severity: Minor
Found in classes/yf_services.class.php - About 2 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 payin has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        payin: function( options ) {
            var $this = this;
            $scope.block_wait     = true;
            $scope.is_submitted   = true;
            $scope.status         = false;
Severity: Major
Found in plugins/content/templates/user/js/ng/payment/balance-recharge.js - About 2 hrs to fix

    Method load__nbu_html has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function load__nbu_html($options = null)
        {
            // import options
            is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
            // var
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 2 hrs to fix

      Method load__nbu has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function load__nbu($options = null)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              // var
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 2 hrs to fix

        Method compare has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function compare($params = [])
            {
                $installer = $this->db->installer();
                $utils = $this->db->utils();
                $db_prefix = $this->db->DB_PREFIX;
        Severity: Major
        Found in plugins/db/classes/db/yf_db_migrator.class.php - About 2 hrs to fix

          Method having has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function having()
              {
                  $sql = '';
                  $where = func_get_args();
                  if ( ! count((array) $where)) {
          Severity: Major
          Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 2 hrs to fix

            Method go has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function go()
                {
                    if ( ! $this->allow()) {
                        return false;
                    }
            Severity: Major
            Found in plugins/logs/classes/logs/yf_logs_exec_user.class.php - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language