aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Function loop_controls has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    public static function loop_controls( $config_id ) {

        // Get an instance of the Generator class.
        // This will make sure google fonts and backup fonts are loaded.
        Generator::get_instance();
Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS.php - About 5 hrs 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 2 has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"10":10,"2":2,"279":279,"280":280,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9}],2:[function(_dereq_,module,exports){
_dereq_(254);
_dereq_(190);
_dereq_(192);
_dereq_(191);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 5 hrs to fix

Function exports has 137 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
    CLAMPED = !!CLAMPED;
    var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
    var GETTER = 'get' + KEY;
    var SETTER = 'set' + KEY;
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 5 hrs to fix

Function fromOutput has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

        fromOutput: function( output, value, controlType ) {
            var styles      = '',
                mediaQuery  = false,
                processedValue;

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

const convertColorForInput = (value, pickerComponent, formComponent) => {
  let rgba;
  let hsv;
  let hsva;
  let convertedValue;

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 convertColorForInput has 124 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const convertColorForInput = (value, pickerComponent, formComponent) => {
  let rgba;
  let hsv;
  let hsva;
  let convertedValue;

Function 223 has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

},{"16":16,"40":40,"47":47,"57":57,"75":75,"77":77,"81":81,"92":92}],223:[function(_dereq_,module,exports){
var global = _dereq_(46);
var inheritIfRequired = _dereq_(51);
var dP = _dereq_(75).f;
var gOPN = _dereq_(79).f;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs 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 40 has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

},{"80":80,"83":83,"84":84}],40:[function(_dereq_,module,exports){
var global = _dereq_(46);
var core = _dereq_(30);
var hide = _dereq_(48);
var redefine = _dereq_(94);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs 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 apply_pattern_replace has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    protected function apply_pattern_replace( $output, $value ) {
        if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) {
            $option_type = ( isset( $this->field['option_type'] ) ) ? $this->field['option_type'] : 'theme_mod';
            $option_name = ( isset( $this->field['option_name'] ) ) ? $this->field['option_name'] : '';
            $options     = [];
Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS/Output.php - About 4 hrs 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 27 has 118 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],27:[function(_dereq_,module,exports){
'use strict';
var dP = _dereq_(75).f;
var create = _dereq_(74);
var redefineAll = _dereq_(93);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs to fix

Method init has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function init( $args = array() ) {

        add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
        add_action( 'customize_preview_init', array( $this, 'enqueue_customize_preview_scripts' ) );
        add_filter( 'kirki_output_control_classnames', array( $this, 'output_control_classnames' ) );
Severity: Major
Found in packages/kirki-framework/field-dimensions/src/Dimensions.php - About 4 hrs to fix

Function convertColorForCustomizer has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

const convertColorForCustomizer = (value, pickerComponent, formComponent) => {
    let rgba;
    let hsv;
    let hsva;
    let convertedValue;

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

    evaluate: function( value1, value2, operator, choice ) {
        var found = false;

        if ( choice && 'object' === typeof value2 ) {
            value2 = value2[ choice ];
Severity: Minor
Found in packages/kirki-framework/module-field-dependencies/src/script.js - About 4 hrs 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 21 has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

},{"117":117,"118":118,"23":23,"32":32,"53":53}],21:[function(_dereq_,module,exports){
var aFunction = _dereq_(11);
var toObject = _dereq_(118);
var IObject = _dereq_(53);
var toLength = _dereq_(117);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs 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 187 has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"40":40,"89":89}],187:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var toInteger = _dereq_(115);
var aNumberValue = _dereq_(12);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs to fix

Function 229 has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"16":16,"43":43,"95":95,"97":97}],229:[function(_dereq_,module,exports){
'use strict';

var isRegExp = _dereq_(58);
var anObject = _dereq_(16);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs to fix

Function 19 has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

},{"113":113,"117":117,"118":118}],19:[function(_dereq_,module,exports){
// false -> Array#indexOf
// true  -> Array#includes
var toIObject = _dereq_(116);
var toLength = _dereq_(117);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs 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 70 has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

},{}],70:[function(_dereq_,module,exports){
var META = _dereq_(123)('meta');
var isObject = _dereq_(57);
var has = _dereq_(47);
var setDesc = _dereq_(75).f;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 4 hrs 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 field_add_control_args has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function field_add_control_args( $args ) {
        if ( isset( $args['active_callback'] ) ) {
            if ( is_array( $args['active_callback'] ) ) {
                if ( ! is_callable( $args['active_callback'] ) ) {

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

    public static function styles_parse( $css = [] ) {

        // Pass our styles from the kirki_styles_array filter.
        $css = apply_filters( 'kirki_styles_array', $css );

Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS/Generator.php - About 4 hrs 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