Showing 3,246 of 4,217 total issues

Function find_asset_type_for_module has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function find_asset_type_for_module($asset_type, $module = '')
    {
        if ( ! $module) {
            $module = $_GET['object'];
        }
Severity: Minor
Found in plugins/assets/classes/yf_assets.class.php - About 45 mins 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 select2_box has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function select2_box($name, $values = [], $selected = '', $extra = [])
    {
        $css = [];
        $style = [];
        if (is_array($name)) {
Severity: Minor
Found in plugins/html/classes/yf_html.class.php - About 45 mins 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 sources has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function sources()
    {
        $vars = $this->_get_all_vars_from_db();
        $files = [];
        foreach ((array) $vars as $source => $a) {
Severity: Minor
Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 45 mins 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 country has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function country()
    {
        asset('bfh-select');

        $args = func_get_args();
Severity: Minor
Found in plugins/html/classes/yf_html.class.php - About 45 mins 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 _js_map_save has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _js_map_save($content, $content_url, $cache_path)
    {
        $map_ext = '.map';
        $map_url = '';
        // Parse inline map url suggest, example: //# sourceMappingURL=lightbox.min.map
Severity: Minor
Found in plugins/assets/classes/yf_assets.class.php - About 45 mins 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 grid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function grid($data = [], $extra = [])
    {
        $extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
        $rows = [];
        $ul_opened = false;
Severity: Minor
Found in plugins/html/classes/yf_html.class.php - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        $object = &$this->object;
        $action = &$this->action;
        $filter_name = &$this->filter_name;
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 45 mins 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 _status has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _status($options = null)
    {
        // check operation
        $operation = $this->_operation($options);
        // import options
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 45 mins 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 _payout_PerfectMoney has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _payout_PerfectMoney($title)
    {
        $payment_api = _class('payment_api');
        $provider_class = $payment_api->provider_class([
            'provider_name' => 'perfectmoney',
Severity: Minor
Found in plugins/payment/modules/yf_payment_test.class.php - About 45 mins 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_interkassa has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_interkassa($options = null)
    {
        // check operation
        $operation = $this->_operation($options);
        // import options
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 45 mins 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 _payout_WebMoney has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _payout_WebMoney($title)
    {
        $payment_api = _class('payment_api');
        $provider_class = $payment_api->provider_class([
            'provider_name' => 'webmoney',
Severity: Minor
Found in plugins/payment/modules/yf_payment_test.class.php - About 45 mins 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_conversion_payout has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function currency_conversion_payout($options)
    {
        // import options
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
        // var
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 45 mins 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 provider_options has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function provider_options(&$provider, $options = null)
    {
        if ( ! isset($options) || ! is_array($provider)) {
            return  false;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api.class.php - About 45 mins 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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _update()
    {
        $currency__api = _class('payment_api__currency');
        $result = true;
        $total = 0;
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_currency.class.php - About 45 mins 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 _payout_Interkassa has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _payout_Interkassa($title)
    {
        $payment_api = _class('payment_api');
        $provider_class = $payment_api->provider_class([
            'provider_name' => 'interkassa',
Severity: Minor
Found in plugins/payment/modules/yf_payment_test.class.php - About 45 mins 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 _payout_YandexMoney has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _payout_YandexMoney($title)
    {
        $payment_api = _class('payment_api');
        $provider_class = $payment_api->provider_class([
            'provider_name' => 'yandexmoney',
Severity: Minor
Found in plugins/payment/modules/yf_payment_test.class.php - About 45 mins 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 config has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function config($options = null)
    {
        ! empty($options) && $this->CONFIG = $options;
        $config = &$this->CONFIG;
        if (is_array($config)) {
Severity: Minor
Found in plugins/payment/classes/yf_payment_api.class.php - About 45 mins 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 amount_limit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function amount_limit($options = null)
    {
        // import options
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
        if ( ! empty($_method['amount'])) {
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 45 mins 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 authorize_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function authorize_request($options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php - About 45 mins 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

Avoid deeply nested control flow statements.
Open

                        if ($real_secret == $secret) {
                            if (in_array($options['status'], $this->success_statuses)) {
                                $operation_add_options['external_response']['action'] = 'approve';
                                $update_data = [
                                    'operation_id' => $operation_id,
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_bitpay.class.php - About 45 mins to fix
    Severity
    Category
    Status
    Source
    Language