aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Method process_output has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function process_output( $output, $value ) {
        $output = wp_parse_args(
            $output,
            [
                'element'     => '',
Severity: Minor
Found in packages/kirki-framework/field-dimensions/src/CSS/Dimensions.php - About 1 hr to fix

Method sanitize_color_array has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function sanitize_color_array( $color, $color_type = 'rgb' ) {

        $keys = [ 'r', 'g', 'b' ];
        $mins = [ 0, 0, 0 ];
        $maxs = [ 255, 255, 255 ];

Function updateLabel has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.updateLabel = function() {
        var rowLabelField,
            rowLabel,
            rowLabelSelector;

Severity: Minor
Found in packages/kirki-framework/control-repeater/src/control.js - About 1 hr to fix

Method to_json has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function to_json() {

        // Get the basics from the parent class.
        parent::to_json();

Severity: Minor
Found in packages/kirki-framework/control-base/src/Control/Base.php - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        if ( ! value || '' === value || 0 === value || '0' === value || 'auto' === value || 'inherit' === value || 'initial' === value ) {
            return true;
        }
Severity: Major
Found in packages/kirki-framework/control-dimension/src/control.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

            if (
                ( isset( $field['kirki_config'] ) && $config_id === $field['kirki_config'] ) ||
                (
                    ( 'global' === $config_id || ! $config_id ) &&
                    ( ! isset( $field['kirki_config'] ) || 'global' === $field['kirki_config'] || ! $field['kirki_config'] )
Severity: Major
Found in packages/kirki-framework/module-css/src/CSS.php - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

        if (
            self::is_plugin() ||
            false === strpos( $url, 'wordpress.org' ) || (
                ! isset( $request['body'] ) ||
                ! isset( $request['body']['plugins'] ) ||
Severity: Major
Found in packages/kirki-framework/util/src/Util.php - About 1 hr to fix

Function 1 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(_dereq_,module,exports){
(function (global){
"use strict";

_dereq_(2);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 55 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 39 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

},{}],39:[function(_dereq_,module,exports){
// all enumerable object keys, includes symbols
var getKeys = _dereq_(83);
var gOPS = _dereq_(80);
var pIE = _dereq_(84);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 55 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 230 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

},{"103":103,"117":117,"14":14,"16":16,"43":43,"58":58,"95":95,"96":96}],230:[function(_dereq_,module,exports){
'use strict';
_dereq_(225);
var anObject = _dereq_(16);
var $flags = _dereq_(44);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 55 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 147 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

},{"104":104,"21":21,"40":40}],147:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var html = _dereq_(49);
var cof = _dereq_(26);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 55 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 255 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

},{"100":100,"102":102,"116":116,"119":119,"123":123,"126":126,"127":127,"128":128,"16":16,"36":36,"39":39,"40":40,"42":42,"46":46,"47":47,"48":48,"55":55,"57":57,"65":65,"70":70,"74":74,"75":75,"77":77,"78":78,"79":79,"80":80,"83":83,"84":84,"92":92,"94":94}],255:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var $typed = _dereq_(122);
var buffer = _dereq_(121);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 55 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 110 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

},{"115":115,"35":35}],110:[function(_dereq_,module,exports){
var $export = _dereq_(40);
var defined = _dereq_(35);
var fails = _dereq_(42);
var spaces = _dereq_(111);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 55 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 addPsr4 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function addPsr4($prefix, $paths, $prepend = false)
    {
        if (!$prefix) {
            // Register directories for the root namespace.
            if ($prepend) {
Severity: Minor
Found in packages/composer/ClassLoader.php - About 55 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 is_disabled has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function is_disabled( $args = [] ) {
        if ( defined( 'KIRKI_NO_OUTPUT' ) && true === KIRKI_NO_OUTPUT ) {
            return true;
        }

Severity: Minor
Found in packages/kirki-framework/module-editor-styles/src/Editor_Styles.php - About 55 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 rgb_to_hsv has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function rgb_to_hsv( $color = array() ) {
        $var_r = ( $color[0] / 255 );
        $var_g = ( $color[1] / 255 );
        $var_b = ( $color[2] / 255 );
        $var_min = min( $var_r, $var_g, $var_b );
Severity: Minor
Found in lib/class-kirki-color.php - About 55 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 from_hsl_array has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        protected function from_hsl_array() {
            $h = $this->hue / 360;
            $s = $this->saturation / 100;
            $l = $this->lightness / 100;

Severity: Minor
Found in lib/class-aricolor.php - About 55 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 is_plugin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function is_plugin() {
        $is_plugin = false;
        if ( ! function_exists( 'get_plugins' ) ) {
            require_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
        }
Severity: Minor
Found in packages/kirki-framework/util/src/Util.php - About 55 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 maybe_change_settings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function maybe_change_settings( $args ) {
        // Check if we have an option-name defined.
        if ( isset( $args['option_name'] ) ) {
            if ( isset( $args['settings'] ) && $args['settings'] && false !== strpos( $args['settings'], $args['option_name'] . '[' ) ) {
                return $args;
Severity: Minor
Found in packages/kirki-framework/data-option/src/Option.php - About 55 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_value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function process_value() {
        if ( is_array( $this->value ) && isset( $this->value['url'] ) ) {
            $this->value = $this->value['url'];
        }
        if ( false === strpos( $this->value, 'gradient' ) && false === strpos( $this->value, 'url(' ) ) {

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