aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Function KirkiSliderForm has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

  let trigger = "";

Severity: Major
Found in packages/kirki-framework/control-slider/src/KirkiSliderForm.js - About 3 hrs to fix

File Repeater.php has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Customizer Control: repeater.
 *
 * @package   kirki-framework/control-repeater
Severity: Minor
Found in packages/kirki-framework/control-repeater/src/Control/Repeater.php - About 3 hrs to fix

Function 276 has a Cognitive Complexity of 22 (exceeds 5 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: 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 222 has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

},{"40":40,"98":98}],222:[function(_dereq_,module,exports){
// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
var dP = _dereq_(75);
var gOPD = _dereq_(77);
var getPrototypeOf = _dereq_(81);
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 28 has 77 lines of code (exceeds 25 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: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 3 hrs to fix

File Background.php has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Override field methods
 *
 * @package   kirki-framework/control-background
Severity: Minor
Found in packages/kirki-framework/field-background/src/Background.php - About 3 hrs to fix

Method get_colors has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function get_colors( $context = 'primary' ) {
        $colors = [
            'primary'     => [ '#ffffff', '#000000', '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#03a9f4', '#00bcd4', '#009688', '#4caf50', '#8bc34a', '#cddc39', '#ffeb3b', '#ffc107', '#ff9800', '#ff5722', '#795548', '#9e9e9e', '#607d8b' ],
            'red'         => [ '#ffebee', '#ffcdd2', '#ef9a9a', '#e57373', '#ef5350', '#f44336', '#e53935', '#d32f2f', '#c62828', '#b71c1c', '#ff8a80', '#ff5252', '#ff1744', '#d50000' ],
            'pink'        => [ '#fce4ec', '#f8bbd0', '#f48fb1', '#f06292', '#ec407a', '#e91e63', '#d81b60', '#c2185b', '#ad1457', '#880e4f', '#ff80ab', '#ff4081', '#f50057', '#c51162' ],
Severity: Major
Found in packages/kirki-framework/util/src/MaterialColors.php - About 3 hrs to fix

Function 112 has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],112:[function(_dereq_,module,exports){
var ctx = _dereq_(32);
var invoke = _dereq_(52);
var html = _dereq_(49);
var cel = _dereq_(37);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Function add_prefixes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public static function add_prefixes( $css ) {
        if ( is_array( $css ) ) {
            foreach ( $css as $media_query => $elements ) {
                foreach ( $elements as $element => $style_array ) {
                    foreach ( $style_array as $property => $value ) {
Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS/Generator.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 43 has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],43:[function(_dereq_,module,exports){
'use strict';
_dereq_(224);
var redefine = _dereq_(94);
var hide = _dereq_(48);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Function 29 has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"125":125,"15":15,"16":16,"20":20,"45":45,"47":47,"57":57,"70":70,"93":93}],29:[function(_dereq_,module,exports){
'use strict';
var global = _dereq_(46);
var $export = _dereq_(40);
var redefine = _dereq_(94);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Function KirkiReactColorfulInput has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const KirkiReactColorfulInput = (props) => {
  const { onChange, color = "" } = props;
  const [value, setValue] = useState(() => color);

  const handleChange = useCallback(

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

    initKirkiControl: function( control ) {
        var limit, theNewRow, settingValue;
        control = control || this;

        // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)
Severity: Major
Found in packages/kirki-framework/control-repeater/src/control.js - About 2 hrs to fix

Method __construct has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct( $manager, $id, $args = [] ) {

        parent::__construct( $manager, $id, $args );

        // Set up defaults for row labels.
Severity: Major
Found in packages/kirki-framework/control-repeater/src/Control/Repeater.php - About 2 hrs to fix

Method get_mode has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function get_mode( $color ) {

            // Check if value is an array.
            if ( is_array( $color ) ) {
                // Does the array have an 'rgba' key?
Severity: Major
Found in lib/class-aricolor.php - About 2 hrs to fix

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

},{"11":11}],33:[function(_dereq_,module,exports){
'use strict';
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var fails = _dereq_(42);
var getTime = Date.prototype.getTime;
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 getNew has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

        public function getNew( $property = '', $value = '' ) {

            if ( in_array( $property, array( 'red', 'green', 'blue', 'alpha' ), true ) ) {
                // Check if we're changing any of the rgba values.
                $value = max( 0, min( 255, $value ) );
Severity: Minor
Found in lib/class-aricolor.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 evaluate has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

        if ( choice && 'object' === typeof value2 ) {
            value2 = value2[ choice ];
Severity: Major
Found in packages/kirki-framework/module-field-dependencies/src/script.js - About 2 hrs to fix

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

    public static function sanitize( $value ) {

        if ( ! is_array( $value ) ) {
            return [];
        }
Severity: Major
Found in packages/kirki-framework/field-background/src/Background.php - About 2 hrs to fix

repeater has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

wp.customize.controlConstructor.repeater = wp.customize.Control.extend( {

    // When we're finished loading continue processing
    ready: function() {
        var control = this;
Severity: Minor
Found in packages/kirki-framework/control-repeater/src/control.js - About 2 hrs to fix
Severity
Category
Status
Source
Language