aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Avoid deeply nested control flow statements.
Open

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

Avoid deeply nested control flow statements.
Open

        else if (res) switch (TYPE) {
          case 3: return true;             // some
          case 5: return val;              // find
          case 6: return index;            // findIndex
          case 2: result.push(val);        // filter
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

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 (arg == undefined) {
                            throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1]))
                        }
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 45 mins to fix

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

Avoid deeply nested control flow statements.
Open

    if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], 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

        } 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

                        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

                                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

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

            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 (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

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

Avoid deeply nested control flow statements.
Open

          } else if (hasFinally) {
            if (this.prev < entry.finallyLoc) {
              return handle(entry.finallyLoc);
            }

Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 45 mins to fix

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

Severity
Category
Status
Source
Language