aristath/kirki

View on GitHub

Showing 644 of 644 total issues

Avoid deeply nested control flow statements.
Open

        if (code < 48 || code > maxCode) return NaN;
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 45 mins to fix

Function NativeFontWatchRunner has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  webfont.NativeFontWatchRunner = function(activeCallback, inactiveCallback, domHelper, font, opt_timeout, opt_fontTestString) {

Avoid deeply nested control flow statements.
Open

                                if ( $url ) {

                                    // 'id' is needed for form hidden value, URL is needed to display the image.
                                    $value = [
                                        'id'       => $attachment_id,
Severity: Major
Found in packages/kirki-framework/control-repeater/src/Control/Repeater.php - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if ($len % BYTES) throw RangeError(WRONG_LENGTH);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 45 mins to fix

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

/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - 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

              for (var j = 0; j < variations.length; j++) {
                fonts.push(new Font(font, variations[j]));
              }

Avoid deeply nested control flow statements.
Open

                        while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
                            if ((field_match = re.key_access.exec(replacement_field)) !== null) {
                                field_list.push(field_match[1])
                            }
                            else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

        } else if (IS_EVERY) return false; // every
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (byteLength < 0) throw RangeError(WRONG_LENGTH);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (this.prev < entry.catchLoc) {
              return handle(entry.catchLoc, true);
            }
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

            if (fontTestString) {
              this.fontTestStrings_[fontFamily] = fontTestString;
            }

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

    public function filter_control_args( $args, $wp_customize ) {
        if ( $args['settings'] === $this->args['settings'] ) {
            $args = parent::filter_control_args( $args, $wp_customize );

            ob_start();
Severity: Minor
Found in packages/kirki-framework/field-fontawesome/src/Field/FontAwesome.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 register_control_types has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function register_control_types() {
        global $wp_customize;

        $this->control_types = $this->default_control_types();
        if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/Init.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 filter_setting_args has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function filter_setting_args( $args, $wp_customize ) {

        if ( $args['settings'] === $this->args['settings'] ) {
            $args = parent::filter_setting_args( $args, $wp_customize );

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

    public function field_add_setting_args( $args ) {

        if ( ! isset( $args['transport'] ) ) {
            return $args;
        }
Severity: Minor
Found in packages/kirki-framework/module-postmessage/src/Postmessage.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 output_item_args has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function output_item_args( $output, $value, $all_outputs, $field ) {
        if ( $field['settings'] === $this->args['settings'] ) {
            if ( isset( $output['property'] ) && in_array( [ 'background', 'background-image' ], $output['property'], true ) ) {
                if ( ! isset( $output['value_pattern'] ) || empty( $output['value_pattern'] ) || '$' === $output['value_pattern'] ) {
                    $output['value_pattern'] = 'url("$")';
Severity: Minor
Found in packages/kirki-framework/control-image/src/Field/Image.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 process_output has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function process_output( $output, $value ) {
        $output = wp_parse_args(
            $output,
            [
                'media_query' => 'global',
Severity: Minor
Found in packages/kirki-framework/field-background/src/CSS/Background.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 process_output has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function process_output( $output, $value ) {
        if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) {
            return;
        }
        $output = wp_parse_args(
Severity: Minor
Found in packages/kirki-framework/control-image/src/Field/CSS/Image.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 process_output has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function process_output( $output, $value ) {
        $output = apply_filters( 'kirki_output_item_args', $output, $value, $this->output, $this->field );

        if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) {
            return;
Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS/Output.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

Severity
Category
Status
Source
Language