aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Avoid too many return statements within this method.
Open

        return $raw_value . $unit_used;
Severity: Major
Found in packages/kirki-framework/compatibility/src/Sanitize_Values.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return self::new_color( 'hsla(' . $value . ',' . $this->saturation . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' );
Severity: Major
Found in lib/class-aricolor.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return 'hex';
Severity: Major
Found in lib/class-aricolor.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return $keeper;
Severity: Major
Found in lib/class-aricolor.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return 'rgba';
Severity: Major
Found in lib/class-aricolor.php - About 30 mins to fix

Function 74 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

},{"118":118,"42":42,"53":53,"80":80,"83":83,"84":84}],74:[function(_dereq_,module,exports){
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = _dereq_(16);
var dPs = _dereq_(76);
var enumBugKeys = _dereq_(38);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 25 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 deleteRow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    deleteRow: function( index ) {
        var currentSettings = this.getValue(),
            row,
            prop;

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

},{"105":105,"40":40}],237:[function(_dereq_,module,exports){
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
'use strict';
var $export = _dereq_(40);
var toLength = _dereq_(117);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 25 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 69 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

},{}],69:[function(_dereq_,module,exports){
// 20.2.2.28 Math.sign(x)
module.exports = Math.sign || function sign(x) {
  // eslint-disable-next-line no-self-compare
  return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 25 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 278 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

},{"112":112,"40":40}],278:[function(_dereq_,module,exports){
// ie9- setTimeout & setInterval additional parameters fix
var global = _dereq_(46);
var $export = _dereq_(40);
var userAgent = _dereq_(124);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 25 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 62 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

},{"100":100,"128":128,"40":40,"48":48,"60":60,"64":64,"65":65,"81":81,"94":94}],62:[function(_dereq_,module,exports){
var ITERATOR = _dereq_(128)('iterator');
var SAFE_CLOSING = false;

try {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 25 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 78 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

},{"116":116,"119":119,"36":36,"47":47,"50":50,"84":84,"92":92}],78:[function(_dereq_,module,exports){
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = _dereq_(116);
var gOPN = _dereq_(79).f;
var toString = {}.toString;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 25 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 useFocusOutside has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const useFocusOutside = (ref, handler) => {
    useEffect(() => {
        const listener = (e) => {
            // Do nothing if the component hasn't been mounted.
            if (!ref.current) return;

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

    public static function getPrettyVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
Severity: Minor
Found in packages/composer/InstalledVersions.php - About 25 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 validateCssValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    validateCssValue: function( value ) {

        var control = this,
            validUnits = [ 'fr', 'rem', 'em', 'ex', '%', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vh', 'vw', 'vmin', 'vmax' ],
            numericValue,
Severity: Minor
Found in packages/kirki-framework/control-dimension/src/control.js - About 25 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 getReference has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getReference($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
Severity: Minor
Found in packages/composer/InstalledVersions.php - About 25 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 array_replace_recursive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function array_replace_recursive( $array, $array1 ) {
        if ( function_exists( 'array_replace_recursive' ) ) {
            return array_replace_recursive( $array, $array1 );
        }

Severity: Minor
Found in packages/kirki-framework/util/src/Helper.php - About 25 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 getVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getVersion($packageName)
    {
        foreach (self::getInstalled() as $installed) {
            if (!isset($installed['versions'][$packageName])) {
                continue;
Severity: Minor
Found in packages/composer/InstalledVersions.php - About 25 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 set_css_vars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function set_css_vars() {
        if ( is_string( $this->css_vars ) ) {
            $this->css_vars = [ $this->css_vars ];
        }
        if ( isset( $this->css_vars[0] ) && is_string( $this->css_vars[0] ) ) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/Field.php - About 25 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 to_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function to_json() {

        parent::to_json();

        $this->json['value'] = strtolower( $this->json['value'] );

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