aristath/kirki

View on GitHub

Showing 644 of 644 total issues

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

},{"107":107}],233:[function(_dereq_,module,exports){
'use strict';
// B.2.3.3 String.prototype.big()
_dereq_(107)('big', function (createHTML) {
  return function big() {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5344..5353
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5353..5362
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5395..5404
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5461..5470
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5526..5535
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5555..5564
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5564..5573
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5573..5582

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 67.

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 9 locations. Consider refactoring.
Open

},{"107":107}],234:[function(_dereq_,module,exports){
'use strict';
// B.2.3.4 String.prototype.blink()
_dereq_(107)('blink', function (createHTML) {
  return function blink() {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5335..5344
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5353..5362
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5395..5404
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5461..5470
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5526..5535
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5555..5564
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5564..5573
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5573..5582

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 67.

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 9 locations. Consider refactoring.
Open

},{"109":109,"40":40}],248:[function(_dereq_,module,exports){
'use strict';
// B.2.3.11 String.prototype.small()
_dereq_(107)('small', function (createHTML) {
  return function small() {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5335..5344
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5344..5353
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5353..5362
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5395..5404
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5461..5470
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5555..5564
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5564..5573
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5573..5582

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 67.

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 9 locations. Consider refactoring.
Open

},{"106":106,"117":117,"40":40,"41":41}],250:[function(_dereq_,module,exports){
'use strict';
// B.2.3.12 String.prototype.strike()
_dereq_(107)('strike', function (createHTML) {
  return function strike() {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5335..5344
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5344..5353
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5353..5362
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5395..5404
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5461..5470
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5526..5535
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5564..5573
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5573..5582

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 67.

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 9 locations. Consider refactoring.
Open

},{"107":107}],235:[function(_dereq_,module,exports){
'use strict';
// B.2.3.5 String.prototype.bold()
_dereq_(107)('bold', function (createHTML) {
  return function bold() {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5335..5344
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5344..5353
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5395..5404
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5461..5470
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5526..5535
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5555..5564
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5564..5573
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5573..5582

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 67.

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 9 locations. Consider refactoring.
Open

},{"106":106,"117":117,"40":40,"41":41}],238:[function(_dereq_,module,exports){
'use strict';
// B.2.3.6 String.prototype.fixed()
_dereq_(107)('fixed', function (createHTML) {
  return function fixed() {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5335..5344
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5344..5353
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5353..5362
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5461..5470
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5526..5535
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5555..5564
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5564..5573
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5573..5582

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 67.

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 checkCondition has a Cognitive Complexity of 13 (exceeds 5 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

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

},{"57":57}],17:[function(_dereq_,module,exports){
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
'use strict';
var toObject = _dereq_(118);
var toAbsoluteIndex = _dereq_(113);
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 get_value has a Cognitive Complexity of 13 (exceeds 5 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

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

    public function process_fonts() {

        // Early exit if font-family is empty.
        if ( empty( $this->fonts ) ) {
            return;
Severity: Minor
Found in packages/kirki-framework/module-webfonts/src/Webfonts/Google.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 createRemoveHook has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createRemoveHook(hooks, removeAll) {
  /**
   * Removes the specified callback (or all callbacks) from the hook with a
   * given hookName and namespace.
   *
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/hooks.js - About 1 hr to fix

Function 255 has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"100":100,"102":102,"116":116,"119":119,"123":123,"126":126,"127":127,"128":128,"16":16,"36":36,"39":39,"40":40,"42":42,"46":46,"47":47,"48":48,"55":55,"57":57,"65":65,"70":70,"74":74,"75":75,"77":77,"78":78,"79":79,"80":80,"83":83,"84":84,"92":92,"94":94}],255:[function(_dereq_,module,exports){
'use strict';
var $export = _dereq_(40);
var $typed = _dereq_(122);
var buffer = _dereq_(121);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr to fix

Function 223 has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"16":16,"40":40,"47":47,"57":57,"75":75,"77":77,"81":81,"92":92}],223:[function(_dereq_,module,exports){
var global = _dereq_(46);
var inheritIfRequired = _dereq_(51);
var dP = _dereq_(75).f;
var gOPN = _dereq_(79).f;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr to fix

Method process_output has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function process_output( $output, $value ) {

        $output = wp_parse_args(
            $output,
            array(

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

    public static function sanitize( $value ) {

        if ( ! is_array( $value ) ) {
            return [];
        }
Severity: Minor
Found in packages/kirki-framework/field-typography/src/Field/Typography.php - About 1 hr to fix

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

        if (this.id && api.control(this.id) && api.control(this.id).params && api.control(this.id).params.parent_setting) {
            parentSetting = api.control(this.id).params.parent_setting;
            newVal = {};
            newVal[this.id.replace(parentSetting + '[', '').replace(']', '')] = to;
            api.control(parentSetting).setting.set(jQuery.extend({}, api.control(parentSetting).setting._value, newVal));
packages/kirki-framework/control-base/src/dynamic-control.js on lines 280..283

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 66.

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

        if (this.id && api.control(this.id) && api.control(this.id).params && api.control(this.id).params.parent_setting) {
            parentSetting = api.control(this.id).params.parent_setting;
            return api.control(parentSetting).setting.get()[this.id.replace(parentSetting + '[', '').replace(']', '')];
        }
packages/kirki-framework/control-base/src/dynamic-control.js on lines 252..257

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 66.

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 AsyncIterator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function AsyncIterator(generator) {
    function invoke(method, arg, resolve, reject) {
      var record = tryCatch(generator[method], generator, arg);
      if (record.type === "throw") {
        reject(record.arg);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr to fix

Function 20 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"113":113,"116":116,"117":117}],20:[function(_dereq_,module,exports){
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr to fix

Function removeHook has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return function removeHook(hookName, namespace) {
    if (!build_module_validateHookName(hookName)) {
      return;
    }

Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/hooks.js - About 1 hr to fix
Severity
Category
Status
Source
Language