aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Function sprintf_format has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function sprintf_format(parse_tree, argv) {
        var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign
        for (i = 0; i < tree_length; i++) {
            if (typeof parse_tree[i] === 'string') {
                output += parse_tree[i]
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 4 hrs to fix

Function 227 has 101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

Function 45 has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

},{"16":16}],45:[function(_dereq_,module,exports){
var ctx = _dereq_(32);
var call = _dereq_(59);
var isArrayIter = _dereq_(54);
var anObject = _dereq_(16);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 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 137 has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

},{"104":104,"20":20,"40":40}],137:[function(_dereq_,module,exports){
'use strict';
var ctx = _dereq_(32);
var $export = _dereq_(40);
var toObject = _dereq_(118);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 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

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

    public function init( $args = [] ) {

        self::$typography_controls[] = $args['settings'];

        self::$std_variants = [
Severity: Major
Found in packages/kirki-framework/field-typography/src/Field/Typography.php - About 3 hrs to fix

Function initKirkiControl has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    initKirkiControl: function( control ) {
        var value, saveAs, preview, previewImage, removeButton, defaultButton;
        control       = control || this;
        value         = control.setting._value;
        saveAs        = ( ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.save_as ) ) ? control.params.choices.save_as : 'url';
Severity: Major
Found in packages/kirki-framework/control-image/src/control.js - About 3 hrs to fix

Consider simplifying this complex logical expression.
Open

if (_dereq_(36)) {
  var LIBRARY = _dereq_(65);
  var global = _dereq_(46);
  var fails = _dereq_(42);
  var $export = _dereq_(40);
Severity: Critical
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 hrs to fix

Function 71 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

},{"123":123,"42":42,"47":47,"57":57,"75":75}],71:[function(_dereq_,module,exports){
var global = _dereq_(46);
var macrotask = _dereq_(112).set;
var Observer = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 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 kirkiTypographyCompositeControlFontProperties has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

function kirkiTypographyCompositeControlFontProperties(id, value) {
  const control = wp.customize.control(id);

  if ("undefined" === typeof control) {
    return;
Severity: Minor
Found in packages/kirki-framework/field-typography/src/control.js - About 3 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 28 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

},{"125":125,"15":15,"32":32,"36":36,"45":45,"61":61,"63":63,"70":70,"74":74,"75":75,"93":93,"99":99}],28:[function(_dereq_,module,exports){
'use strict';
var redefineAll = _dereq_(93);
var getWeak = _dereq_(70).getWeak;
var anObject = _dereq_(16);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 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 compare_values has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static function compare_values( $value1, $value2, $operator ) {
        if ( '===' === $operator ) {
            return $value1 === $value2;
        }
        if ( '!==' === $operator ) {
Severity: Minor
Found in packages/kirki-framework/util/src/Helper.php - About 3 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 get_font_family_choices has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private function get_font_family_choices() {

        $args = $this->args;

        // Figure out how to sort the fonts.
Severity: Minor
Found in packages/kirki-framework/field-typography/src/Field/Typography.php - About 3 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 convertColorForCustomizer has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Function KirkiSliderForm has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

const KirkiSliderForm = (props) => {
  const { control, customizerSetting, choices } = props;

  let trigger = "";

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

},{}],43:[function(_dereq_,module,exports){
'use strict';
_dereq_(224);
var redefine = _dereq_(94);
var hide = _dereq_(48);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 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_value_pattern has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    protected function apply_value_pattern( $output, $value ) {
        if ( isset( $output['value_pattern'] ) && is_string( $output['value_pattern'] ) ) {
            if ( ! is_array( $value ) ) {
                $value = str_replace( '$', $value, $output['value_pattern'] );
            }
Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS/Output.php - About 3 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 fromOutput has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in packages/kirki-framework/module-postmessage/src/postMessage.js - About 3 hrs to fix

Method sanitize has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function sanitize( $value ) {

        // is the value formatted as a string?
        if ( is_string( $value ) ) {
            $value = rawurldecode( $value );
Severity: Major
Found in packages/kirki-framework/control-repeater/src/Field/Repeater.php - About 3 hrs to fix

Function kirkiTypographyCompositeControlFontProperties has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function kirkiTypographyCompositeControlFontProperties(id, value) {
  const control = wp.customize.control(id);

  if ("undefined" === typeof control) {
    return;
Severity: Major
Found in packages/kirki-framework/field-typography/src/control.js - About 3 hrs to fix

Function 25 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

},{"11":11,"52":52,"57":57}],25:[function(_dereq_,module,exports){
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = _dereq_(26);
var TAG = _dereq_(128)('toStringTag');
// ES3 wrong here
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 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