Showing 3,246 of 4,217 total issues

Function mail has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function mail($options = null)
    {
        // DEBUG
        // ini_set( 'html_errors', 0 );
        // var_dump( $options );
Severity: Minor
Found in plugins/payment/classes/yf_payment_api.class.php - About 3 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 rates has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function rates($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 3 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 csv_ecommpay has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function csv_ecommpay($options = null)
    {
        $operation_id = &$_POST['operation_id'];
        if ( ! is_array($operation_id) || count($operation_id) < 1) {
            common()->message_info('Отсутствуют данные');
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 3 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 api_payout has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function api_payout($options = null)
    {
        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 _recursive_get_methods_from_extends has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $ONLY_PRIVATE_METHODS = false)
    {
        // TODO: need to add 'site__' and 'adm__' functionality
        $extends_file_path = '';
        $methods = [];
Severity: Minor
Found in plugins/sys/classes/core_api/yf_core_api_user_modules.class.php - About 3 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 api_payout has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function api_payout($options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_payeer.class.php - About 3 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 _parse_column_type has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _parse_column_type($str, &$error = false)
    {
        // TODO: use db ddl parser if available for the given db family (mysql currently supported)
        $str = trim($str);
        $type = $length = $decimals = $values = null;
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 3 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 _init has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        $this->REWRITE_PATTERNS = [
            'yf' => _class('rewrite_pattern_yf', 'classes/rewrite/'),
        ];
Severity: Minor
Found in plugins/rewrite/classes/yf_rewrite.class.php - About 3 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 image has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function image($name, $path, $link = '', $extra = [], $table)
    {
        if (is_array($path)) {
            $extra = (array) $extra + $path;
            $path = '';
Severity: Minor
Found in plugins/table2/classes/table2/yf_table2_image.class.php - About 3 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 multi_del has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function multi_del($names = [])
    {
        $do_real_work = true;
        if ( ! $this->_driver_ok) {
            $do_real_work = false;
Severity: Minor
Found in plugins/cache/classes/yf_cache.class.php - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function view($params = [])
    {
        if ( ! is_array($params)) {
            $params = [];
        }
Severity: Minor
Found in plugins/common/classes/common/yf_dashboards.class.php - About 3 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 _data has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _data($id)
    {
        if (strpos($id, ':')) {
            $id = array_map([$this, 'id'], explode(':', $id));
            return [
Severity: Minor
Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 3 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 _db_exists has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _db_exists($name, $options = [])
    {
        $cache = &$this->cache;
        $_ = $options;
        $key = $_['key'];

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

    public function _recursive_get_methods_from_extends($file_text = '', $user_module_name = '', $ONLY_PRIVATE_METHODS = false)
    {
        // TODO: need to add 'site__' and 'adm__' functionality
        $extends_file_path = '';
        $methods = [];
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 3 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_modules_from_files has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
    {
        $modules = [];

        $yf_prefix_len = strlen(YF_PREFIX);
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 3 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 go has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function go()
    {
        if ($this->DEBUG_CONSOLE_HIDDEN) {
            return false;
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 3 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 _external_response has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _external_response()
    {
        $operation_id = $_GET['operation_id'];
        $secret = $_GET['secret'];
        $payment_api = $this->payment_api;
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_bitcoin.class.php - About 3 hrs to fix

    Method _rewrite_replace_links has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _rewrite_replace_links($body = '', $standalone = false, $force_rewrite = false, $for_site_id = false)
        {
            if (MAIN_TYPE_ADMIN && ! $force_rewrite) {
                return $body;
            }
    Severity: Major
    Found in plugins/rewrite/classes/yf_rewrite.class.php - About 3 hrs to fix

      Method _search_autocomplete has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _search_autocomplete($options = [])
          {
              main()->NO_GRAPHICS = true;
              // prepare options
              $_ = &$options;

        Method show_metatags has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function show_metatags($meta = [])
            {
                if (empty($meta)) {
                    $meta = $this->META_DEFAULT;
                }
        Severity: Major
        Found in classes/yf_graphics.class.php - About 3 hrs to fix
          Severity
          Category
          Status
          Source
          Language