aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Function 177 has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"40":40}],177:[function(_dereq_,module,exports){
'use strict';
var global = _dereq_(46);
var has = _dereq_(47);
var cof = _dereq_(26);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Function convertColorForPicker has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const convertColorForPicker = (value, pickerComponent) => {
    let convertedValue;

    switch (pickerComponent) {
        case 'HexColorPicker':

File Field.php has 265 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Creates and validates field parameters.
 *
 * @package     Kirki
Severity: Minor
Found in packages/kirki-framework/compatibility/src/Field.php - About 2 hrs to fix

Consider simplifying this complex logical expression.
Open

if (_dereq_(36) && (!CORRECT_NEW || _dereq_(42)(function () {
  re2[_dereq_(128)('match')] = false;
  // RegExp constructor can alter flags and IsRegExp works correct with @@match
  return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
}))) {
Severity: Critical
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

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

module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  var Base = global[NAME];
  var C = Base;
  var ADDER = IS_MAP ? 'set' : 'add';
  var proto = C && C.prototype;
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Method filter_control_args has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function filter_control_args( $args, $wp_customize ) {
        if ( $args['settings'] === $this->args['settings'] ) {
            $args = parent::filter_control_args( $args, $wp_customize );

            $args['type'] = 'code_editor';
Severity: Major
Found in packages/kirki-framework/control-code/src/Field/Code.php - About 2 hrs to fix

Function 94 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

},{"94":94}],94:[function(_dereq_,module,exports){
var global = _dereq_(46);
var hide = _dereq_(48);
var has = _dereq_(47);
var SRC = _dereq_(123)('src');
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 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 52 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

},{"57":57,"98":98}],52:[function(_dereq_,module,exports){
// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function (fn, args, that) {
  var un = that === undefined;
  switch (args.length) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 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 initKirkiControl has a Cognitive Complexity of 17 (exceeds 5 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: Minor
Found in packages/kirki-framework/control-image/src/control.js - About 2 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 142 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

},{"104":104,"116":116,"40":40,"53":53}],142:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var toIObject = _dereq_(116);
var toInteger = _dereq_(115);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 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 73 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

},{"11":11}],73:[function(_dereq_,module,exports){
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var getKeys = _dereq_(83);
var gOPS = _dereq_(80);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 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 getInstalled has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getInstalled()
    {
        if (null === self::$canGetVendors) {
            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
        }
Severity: Minor
Found in packages/composer/InstalledVersions.php - About 2 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 276 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"126":126}],276:[function(_dereq_,module,exports){
var $iterators = _dereq_(140);
var getKeys = _dereq_(83);
var redefine = _dereq_(94);
var global = _dereq_(46);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Function KirkiColorPaletteForm has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const KirkiColorPaletteForm = (props) => {

    const { control, customizerSetting, choices } = props;

    const [selectedItem, setSelectedItem] = useState(props.value);

Function 71 has 54 lines of code (exceeds 25 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: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Method generate_google_font has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function generate_google_font( $args ) {

        // Process typography fields.
        $process = ( ( isset( $args['type'] ) && 'kirki-typography' === $args['type'] ) || ( isset( $args['choices'] ) && isset( $args['choices']['parent_type'] ) && 'kirki-typography' === $args['choices']['parent_type'] ) );
        if ( apply_filters( 'kirki_generate_google_font', $process, $args ) ) {
Severity: Major
Found in packages/kirki-framework/module-webfonts/src/Webfonts/Google.php - About 2 hrs to fix

Method from_hsl_array has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Major
Found in lib/class-aricolor.php - About 2 hrs to fix

Function makeInvokeMethod has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function makeInvokeMethod(innerFn, self, context) {
    var state = GenStateSuspendedStart;

    return function invoke(method, arg) {
      if (state === GenStateExecuting) {
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Function 22 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

},{"11":11,"117":117,"118":118,"53":53}],22:[function(_dereq_,module,exports){
var isObject = _dereq_(57);
var isArray = _dereq_(55);
var SPECIES = _dereq_(128)('species');

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

    public static function get_variables() {

        $variables = [];
        $fields    = self::$variables_fields;

Severity: Minor
Found in packages/kirki-framework/util/src/Util.php - About 2 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