aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Function load has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Typekit.prototype.load = function(onReady) {
    var kitId = this.configuration_['id'];
    var configuration = this.configuration_;
    var loadWindow = this.domHelper_.getLoadWindow();
    var that = this;

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

    public function __construct( $config_id = 'global', $args = [] ) {

        // In case the user only provides 1 argument,
        // assume that the provided argument is $args and set $config_id = 'global'.
        if ( is_array( $config_id ) && empty( $args ) ) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/Field.php - About 1 hr to fix

Method rgb_to_hsv has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function rgb_to_hsv( $color = array() ) {
        $var_r = ( $color[0] / 255 );
        $var_g = ( $color[1] / 255 );
        $var_b = ( $color[2] / 255 );
        $var_min = min( $var_r, $var_g, $var_b );
Severity: Minor
Found in lib/class-kirki-color.php - About 1 hr to fix

Method get_value has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function get_value( $config_id = '', $field_id = '' ) {

        // Make sure value is defined.
        $value = '';

Severity: Minor
Found in packages/kirki-framework/compatibility/src/Values.php - About 1 hr to fix

Function checkCondition has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    checkCondition: function( requirement, control, isOption, relation ) {
        var self          = this,
            childRelation = ( 'AND' === relation ) ? 'OR' : 'AND',
            nestedItems,
            value,
Severity: Minor
Found in packages/kirki-framework/module-field-dependencies/src/script.js - About 1 hr to fix

Function 226 has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"36":36,"44":44,"75":75}],226:[function(_dereq_,module,exports){
'use strict';

var anObject = _dereq_(16);
var toLength = _dereq_(117);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr to fix

Function 137 has 32 lines of code (exceeds 25 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 1 hr to fix

Function 74 has 32 lines of code (exceeds 25 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 1 hr to fix

Method render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function render() {

        $id    = 'customize-control-' . str_replace( [ '[', ']' ], [ '-', '' ], $this->id );
        $class = 'customize-control customize-control-kirki customize-control-' . $this->type;
        $gap   = isset( $this->wrapper_opts['gap'] ) ? $this->wrapper_opts['gap'] : 'default';
Severity: Minor
Found in packages/kirki-framework/control-base/src/Control/Base.php - About 1 hr to fix

Function 82 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

},{"101":101,"118":118,"47":47}],82:[function(_dereq_,module,exports){
var has = _dereq_(47);
var toIObject = _dereq_(116);
var arrayIndexOf = _dereq_(19)(false);
var IE_PROTO = _dereq_(101)('IE_PROTO');
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr 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 98 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

},{}],98:[function(_dereq_,module,exports){
// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = _dereq_(57);
var anObject = _dereq_(16);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr 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 77 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

},{"16":16,"36":36,"75":75,"83":83}],77:[function(_dereq_,module,exports){
var pIE = _dereq_(84);
var createDesc = _dereq_(92);
var toIObject = _dereq_(116);
var toPrimitive = _dereq_(119);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr 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 row_label has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function row_label( $args ) {

        // Validating args for row labels.
        if ( isset( $args['row_label'] ) && is_array( $args['row_label'] ) && ! empty( $args['row_label'] ) ) {

Severity: Minor
Found in packages/kirki-framework/control-repeater/src/Control/Repeater.php - About 1 hr 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 getLoader has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getLoader()
    {
        if (null !== self::$loader) {
            return self::$loader;
        }
Severity: Minor
Found in packages/composer/autoload_real.php - About 1 hr 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 css_dimension has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function css_dimension( $value ) {

        // Trim it.
        $value = trim( $value );

Severity: Minor
Found in packages/kirki-framework/compatibility/src/Sanitize_Values.php - About 1 hr 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 filter_setting_args has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

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

            // Set the sanitize-callback if none is defined.
Severity: Minor
Found in packages/kirki-framework/control-image/src/Field/Image.php - About 1 hr 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 process_output has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function process_output( $output, $value ) {
        foreach ( $value as $key => $sub_value ) {

            // If "element" is not defined, there's no reason to continue.
            if ( ! isset( $output['element'] ) ) {

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

    protected function render() {

        $id    = 'customize-control-' . str_replace( [ '[', ']' ], [ '-', '' ], $this->id );
        $class = 'customize-control customize-control-kirki customize-control-' . $this->type;
        $gap   = isset( $this->wrapper_opts['gap'] ) ? $this->wrapper_opts['gap'] : 'default';
Severity: Minor
Found in packages/kirki-framework/control-base/src/Control/Base.php - About 1 hr 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 add_sub_fields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function add_sub_fields( $args ) {

        $args['kirki_config'] = isset( $args['kirki_config'] ) ? $args['kirki_config'] : 'global';

        $defaults = isset( $args['default'] ) ? $args['default'] : [];
Severity: Minor
Found in packages/kirki-framework/field-typography/src/Field/Typography.php - About 1 hr 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 add_settings has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    final function add_settings( $args = [] ) {

        // Get the classname we'll be using to create our setting(s).
        $classname = false;
        if ( isset( $args['option_type'] ) && array_key_exists( $args['option_type'], $this->setting_types ) ) {
Severity: Minor
Found in packages/kirki-framework/compatibility/src/Settings.php - About 1 hr 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