aristath/kirki

View on GitHub

Showing 644 of 644 total issues

Identical blocks of code found in 2 locations. 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 );

packages/kirki-framework/control-generic/src/Field/Number.php on lines 38..51

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

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

    addRow: function( data ) {
        var control       = this,
            template      = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ).
            settingValue  = this.getValue(), // Get the current setting value.
            newRowSetting = {}, // Saves the new setting data.
Severity: Minor
Found in packages/kirki-framework/control-repeater/src/control.js - About 1 hr to fix

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

  Monotype.prototype.load = function(onReady) {
    var self = this;
    var projectId = self.configuration_['projectId'];
    var version = self.configuration_['version'];
  

Method compare_values has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function compare_values( $value1, $value2, $operator ) {
        if ( '===' === $operator ) {
            return $value1 === $value2;
        }
        if ( '!==' === $operator ) {
Severity: Minor
Found in packages/kirki-framework/util/src/Helper.php - About 1 hr to fix

Function dispatchException has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    dispatchException: function(exception) {
      if (this.done) {
        throw exception;
      }

Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 hr to fix

Method the_css has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function the_css() {
        foreach ( $this->fonts_to_load as $font ) {
            $family  = str_replace( ' ', '+', trim( $font['family'] ) );
            $weights = join( ',', $font['weights'] );
            $url     = "https://fonts.googleapis.com/css?family={$family}:{$weights}&subset=cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai";
Severity: Minor
Found in packages/kirki-framework/module-webfonts/src/Webfonts/Embed.php - About 1 hr to fix

Method field_init has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function field_init( $args, $object ) {
        if ( ! isset( $args['output'] ) ) {
            $args['output'] = array();
        }

Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS.php - About 1 hr to fix

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

},{"107":107}],239:[function(_dereq_,module,exports){
'use strict';
// B.2.3.7 String.prototype.fontcolor(color)
_dereq_(107)('fontcolor', function (createHTML) {
  return function fontcolor(color) {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5326..5335
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5413..5422
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5489..5498

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

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

        case 'HsvStringColorPicker':
            hsv = colord(value).toHsv();
            convertedValue = 'hsv(' + hsv.h + ', ' + hsv.s + '%, ' + hsv.v + '%)';
            break;
packages/kirki-framework/control-react-colorful/src/js/utils/convertColorForInput.js on lines 136..139

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

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

},{"125":125,"27":27,"29":29}],232:[function(_dereq_,module,exports){
'use strict';
// B.2.3.2 String.prototype.anchor(name)
_dereq_(107)('anchor', function (createHTML) {
  return function anchor(name) {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5404..5413
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5413..5422
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5489..5498

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

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

},{"105":105,"61":61}],245:[function(_dereq_,module,exports){
'use strict';
// B.2.3.10 String.prototype.link(url)
_dereq_(107)('link', function (createHTML) {
  return function link(url) {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5326..5335
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5404..5413
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5413..5422

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

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

},{"107":107}],240:[function(_dereq_,module,exports){
'use strict';
// B.2.3.8 String.prototype.fontsize(size)
_dereq_(107)('fontsize', function (createHTML) {
  return function fontsize(size) {
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5326..5335
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5404..5413
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 5489..5498

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

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

    case "HsvColorPicker":
      hsv = colord(value).toHsv();
      convertedValue = "hsv(" + hsv.h + ", " + hsv.s + "%, " + hsv.v + "%)";
      break;
packages/kirki-framework/control-react-colorful/src/js/utils/convertColorForCustomizer.js on lines 113..116

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

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

  FontWatcher.prototype.watchFonts = function(fonts,
      fontTestStrings, metricCompatibleFonts, last) {
    var length = fonts.length,
        testStrings = fontTestStrings || {};

Method loop_controls has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function loop_controls( $config_id ) {

        // Get an instance of the Generator class.
        // This will make sure google fonts and backup fonts are loaded.
        Generator::get_instance();
Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS.php - About 1 hr to fix

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

        if ( $line_height_field_specified || $letter_spacing_field_specified ) {
            $group = [
                'line-height'    => [
                    'type'         => 'dimension',
                    'label'        => esc_html__( 'Line Height', 'kirki' ),
packages/kirki-framework/field-typography/src/Field/Typography.php on lines 399..420

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

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

        if ( $margin_top_field_specified || $margin_bottom_field_specified ) {
            $group = [
                'margin-top'    => [
                    'type'         => 'dimension',
                    'label'        => esc_html__( 'Margin Top', 'kirki' ),
packages/kirki-framework/field-typography/src/Field/Typography.php on lines 373..394

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

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

},{"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

},{"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

Severity
Category
Status
Source
Language