aristath/kirki

View on GitHub

Showing 644 of 644 total issues

Function 208 has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
Open

},{"40":40,"89":89}],208:[function(_dereq_,module,exports){
'use strict';
var LIBRARY = _dereq_(65);
var global = _dereq_(46);
var ctx = _dereq_(32);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 day 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 121 has 250 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"103":103,"113":113,"114":114,"115":115,"117":117,"118":118,"119":119,"121":121,"122":122,"123":123,"128":128,"129":129,"140":140,"15":15,"17":17,"18":18,"19":19,"20":20,"25":25,"32":32,"36":36,"40":40,"42":42,"46":46,"47":47,"48":48,"54":54,"57":57,"62":62,"64":64,"65":65,"74":74,"75":75,"77":77,"79":79,"81":81,"92":92,"93":93,"99":99}],121:[function(_dereq_,module,exports){
'use strict';
var global = _dereq_(46);
var DESCRIPTORS = _dereq_(36);
var LIBRARY = _dereq_(65);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 day to fix

File i18n.js has 568 lines of code (exceeds 250 allowed). Consider refactoring.
Open

this["wp"] = this["wp"] || {}; this["wp"]["i18n"] =
/******/ (function(modules) { // webpackBootstrap
/******/     // The module cache
/******/     var installedModules = {};
/******/
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 1 day to fix

Function sanitize has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

    public function sanitize( $value ) {

        // is the value formatted as a string?
        if ( is_string( $value ) ) {
            $value = rawurldecode( $value );
Severity: Minor
Found in packages/kirki-framework/control-repeater/src/Field/Repeater.php - About 1 day 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

File class-aricolor.php has 548 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// phpcs:ignoreFile

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
Severity: Major
Found in lib/class-aricolor.php - About 1 day to fix

Function 366 has 228 lines of code (exceeds 25 allowed). Consider refactoring.
Open

/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);

Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/hooks.js - About 1 day to fix

Function 187 has a Cognitive Complexity of 56 (exceeds 5 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: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 day 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

File Typography.php has 529 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Override field methods
 *
 * @package   kirki-framework/control-typography
Severity: Major
Found in packages/kirki-framework/field-typography/src/Field/Typography.php - About 1 day to fix

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

    removeImage: function( event ) {
        var $targetDiv,
            $uploadButton;

        if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
Severity: Major
Found in packages/kirki-framework/control-repeater/src/control.js and 1 other location - About 1 day to fix
packages/kirki-framework/control-repeater/src/control.js on lines 507..527

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

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

    removeFile: function( event ) {
        var $targetDiv,
            $uploadButton;

        if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
Severity: Major
Found in packages/kirki-framework/control-repeater/src/control.js and 1 other location - About 1 day to fix
packages/kirki-framework/control-repeater/src/control.js on lines 486..505

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

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

    public function generate_google_font( $args ) {

        // Process typography fields.
        $process = ( ( isset( $args['type'] ) && 'kirki-typography' === $args['type'] ) || ( isset( $args['choices'] ) && isset( $args['choices']['parent_type'] ) && 'kirki-typography' === $args['choices']['parent_type'] ) );
        if ( apply_filters( 'kirki_generate_google_font', $process, $args ) ) {
Severity: Minor
Found in packages/kirki-framework/module-webfonts/src/Webfonts/Google.php - About 1 day 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

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

    wp.customize.bind( 'pane-contents-reflowed', function() {

        var sections = [];

        // Reflow Sections.
Severity: Major
Found in packages/kirki-framework/module-sections/src/script.js and 1 other location - About 1 day to fix
packages/kirki-framework/module-panels/src/script.js on lines 10..28

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

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

    wp.customize.bind( 'pane-contents-reflowed', function() {

        var panels = [];

        // Reflow Panels.
Severity: Major
Found in packages/kirki-framework/module-panels/src/script.js and 1 other location - About 1 day to fix
packages/kirki-framework/module-sections/src/script.js on lines 41..61

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

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

/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */

!function() {
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 1 day to fix

File control.js has 512 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import "./control.scss";

/* global kirkiControlLoader */
/* eslint max-depth: 0 */
/* eslint no-useless-escape: 0 */
Severity: Major
Found in packages/kirki-framework/control-repeater/src/control.js - About 1 day to fix

Function 61 has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

},{"100":100,"128":128,"48":48,"74":74,"92":92}],61:[function(_dereq_,module,exports){
'use strict';
var LIBRARY = _dereq_(65);
var $export = _dereq_(40);
var redefine = _dereq_(94);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 1 day 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

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

},{"13":13,"20":20,"40":40}],135:[function(_dereq_,module,exports){
'use strict';
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
var $export = _dereq_(40);
var $find = _dereq_(20)(5);
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3260..3276

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

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

},{"104":104,"20":20,"40":40}],134:[function(_dereq_,module,exports){
'use strict';
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
var $export = _dereq_(40);
var $find = _dereq_(20)(6);
packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js on lines 3276..3292

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

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

},{"110":110}],254:[function(_dereq_,module,exports){
'use strict';
// ECMAScript 6 symbols shim
var global = _dereq_(46);
var has = _dereq_(47);
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 7 hrs to fix

File installed.php has 493 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php return array(
    'root' => array(
        'pretty_version' => 'dev-develop',
        'version' => 'dev-develop',
        'type' => 'library',
Severity: Minor
Found in packages/composer/installed.php - About 7 hrs to fix
Severity
Category
Status
Source
Language