aristath/kirki

View on GitHub

Showing 644 of 644 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

},{"104":104,"21":21,"40":40}],146:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var $reduce = _dereq_(21);

packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3474..3486

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 133.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

<?php
/**
 * Override field methods
 *
 * @package   kirki-framework/control-date
Severity: Major
Found in packages/kirki-framework/control-date/src/Field/Date.php and 4 other locations - About 4 hrs to fix
packages/kirki-framework/control-custom/src/Field/Custom.php on lines 1..84
packages/kirki-framework/control-dashicons/src/Field/Dashicons.php on lines 1..84
packages/kirki-framework/control-dimension/src/Field/Dimension.php on lines 1..84
packages/kirki-framework/control-editor/src/Field/Editor.php on lines 1..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 181.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

<?php
/**
 * Override field methods
 *
 * @package   Kirki
packages/kirki-framework/control-custom/src/Field/Custom.php on lines 1..84
packages/kirki-framework/control-dashicons/src/Field/Dashicons.php on lines 1..84
packages/kirki-framework/control-date/src/Field/Date.php on lines 1..86
packages/kirki-framework/control-editor/src/Field/Editor.php on lines 1..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 181.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

<?php
/**
 * Override field methods
 *
 * @package   kirki-framework/control-dashicons
packages/kirki-framework/control-custom/src/Field/Custom.php on lines 1..84
packages/kirki-framework/control-date/src/Field/Date.php on lines 1..86
packages/kirki-framework/control-dimension/src/Field/Dimension.php on lines 1..84
packages/kirki-framework/control-editor/src/Field/Editor.php on lines 1..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 181.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

<?php
/**
 * Override field methods
 *
 * @package   kirki-framework/control-editor
packages/kirki-framework/control-custom/src/Field/Custom.php on lines 1..84
packages/kirki-framework/control-dashicons/src/Field/Dashicons.php on lines 1..84
packages/kirki-framework/control-date/src/Field/Date.php on lines 1..86
packages/kirki-framework/control-dimension/src/Field/Dimension.php on lines 1..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 181.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

<?php
/**
 * Override field methods when used with the Kirki API.
 *
 * @package   kirki-framework/control-custom
packages/kirki-framework/control-dashicons/src/Field/Dashicons.php on lines 1..84
packages/kirki-framework/control-date/src/Field/Date.php on lines 1..86
packages/kirki-framework/control-dimension/src/Field/Dimension.php on lines 1..84
packages/kirki-framework/control-editor/src/Field/Editor.php on lines 1..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 181.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

module.exports = {
    externals: {
        "jquery": "jQuery",
        "react": "React",
        "react-dom": "ReactDOM"
packages/kirki-framework/control-slider/webpack.config.js on lines 3..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 132.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

module.exports = {
    externals: {
        "jquery": "jQuery",
        "react": "React",
        "react-dom": "ReactDOM"
Severity: Major
Found in packages/kirki-framework/control-slider/webpack.config.js and 1 other location - About 4 hrs to fix
packages/kirki-framework/control-color-palette/webpack.config.js on lines 3..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 132.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

},{"13":13,"17":17,"40":40}],131:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var $every = _dereq_(20)(4);

packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3248..3260
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3441..3453
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3528..3540

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

},{"104":104,"115":115,"116":116,"117":117,"40":40}],143:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var $map = _dereq_(20)(1);

packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3228..3240
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3248..3260
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3528..3540

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

},{"13":13,"18":18,"40":40}],133:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var $filter = _dereq_(20)(2);

packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3228..3240
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3441..3453
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3528..3540

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

},{"113":113,"117":117,"26":26,"40":40,"42":42,"49":49}],148:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var $some = _dereq_(20)(3);

packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3228..3240
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3248..3260
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3441..3453

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 131.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

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
Severity
Category
Status
Source
Language