aristath/kirki

View on GitHub

Showing 449 of 644 total issues

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

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

    public function http_request( $request = [], $url = '' ) {

        // Early exit if installed as a plugin or not a request to wordpress.org,
        // or finally if we don't have everything we need.
        if (
Severity: Minor
Found in packages/kirki-framework/util/src/Util.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

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 onModuleReady_ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

},{"40":40,"68":68}],161:[function(_dereq_,module,exports){
// 20.2.2.5 Math.asinh(x)
var $export = _dereq_(40);
var $asinh = Math.asinh;

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

    mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) {
        return ! ( ( true === flexW && true === flexH ) || ( true === flexW && dstH === imgH ) || ( true === flexH && dstW === imgW ) || ( dstW === imgW && dstH === imgH ) || ( imgW <= dstW ) );
    },
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

Severity
Category
Status
Source
Language