aristath/kirki

View on GitHub

Showing 449 of 644 total issues

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

    public function color_swatches() {

        $default_swatches = [
            '#000000',
            '#ffffff',

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

Consider simplifying this complex logical expression.
Open

  if (
    'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
    'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
    'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
    '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

  if (
    !DELEGATES_TO_SYMBOL ||
    !DELEGATES_TO_EXEC ||
    (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
    (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

            if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['js_vars'] ) && ! empty( $field['js_vars'] ) && is_array( $field['js_vars'] ) && isset( $field['settings'] ) ) {
                $data[] = $field;
            }
Severity: Major
Found in packages/kirki-framework/module-postmessage/src/Postmessage.php - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

                    if ( isset( $this->args['choices']['save_as'] ) && 'array' === $this->args['choices']['save_as'] ) {
                        return [
                            'id'     => ( isset( $value['id'] ) && '' !== $value['id'] ) ? (int) $value['id'] : '',
                            'url'    => ( isset( $value['url'] ) && '' !== $value['url'] ) ? esc_url_raw( $value['url'] ) : '',
                            'width'  => ( isset( $value['width'] ) && '' !== $value['width'] ) ? (int) $value['width'] : '',
Severity: Major
Found in packages/kirki-framework/control-image/src/Field/Image.php - About 40 mins to fix

Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 35 mins to fix

Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

module.exports = function (that, callbackfn, aLen, memo, isRight) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 35 mins to fix

Function fns has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 35 mins to fix

Function dcnpgettext has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 35 mins to fix

Function _nx has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function _nx(single, plural, number, context, domain) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 35 mins to fix

Function onModuleReady_ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  WebFont.prototype.onModuleReady_ = function(eventDispatcher, fontWatcher, fonts, opt_fontTestStrings, opt_metricCompatibleFonts) {

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

},{"128":128,"26":26,"57":57}],59:[function(_dereq_,module,exports){
// call something on iterator step with safe closing on error
var anObject = _dereq_(16);
module.exports = function (iterator, fn, value, entries) {
  try {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 35 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 getMimeType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    getMimeType: function() {

        // We get the field id from which this was called
        var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' );

Severity: Minor
Found in packages/kirki-framework/control-repeater/src/control.js - About 35 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 81 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

},{}],81:[function(_dereq_,module,exports){
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = _dereq_(47);
var toObject = _dereq_(118);
var IE_PROTO = _dereq_(101)('IE_PROTO');
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 35 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 fromOutput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        fromOutput: function( output, value ) {

            if ( output.js_callback && 'function' === typeof window[ output.js_callback ] ) {
                value = window[ output.js_callback[0] ]( value, output.js_callback[1] );
            }
Severity: Minor
Found in packages/kirki-framework/module-postmessage/src/postMessage.js - About 35 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 95 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

},{"123":123,"30":30,"46":46,"47":47,"48":48}],95:[function(_dereq_,module,exports){
'use strict';

var classof = _dereq_(25);
var builtinExec = RegExp.prototype.exec;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 35 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