aristath/kirki

View on GitHub

Showing 449 of 644 total issues

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

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

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

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

Method add_sub_fields has 192 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function add_sub_fields( $args ) {

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

        $defaults = isset( $args['default'] ) ? $args['default'] : [];
Severity: Major
Found in packages/kirki-framework/field-typography/src/Field/Typography.php - About 7 hrs to fix

Function 177 has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

},{"40":40}],177:[function(_dereq_,module,exports){
'use strict';
var global = _dereq_(46);
var has = _dereq_(47);
var cof = _dereq_(26);
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 7 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 41 has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

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

module.exports = function memize( fn, options ) {
    var size = 0,
        maxSize, head, tail;
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 7 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

Method init has 173 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function init( $args ) {

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

Severity: Major
Found in packages/kirki-framework/field-background/src/Background.php - About 6 hrs to fix

Method repeater_js_template has 165 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function repeater_js_template() {
        ?>

        <script type="text/html" class="customize-control-repeater-content">
            <# var field; var index = data.index; #>
Severity: Major
Found in packages/kirki-framework/control-repeater/src/Control/Repeater.php - About 6 hrs to fix

Function __construct has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct( $manager, $id, $args = [] ) {

        parent::__construct( $manager, $id, $args );

        // Set up defaults for row labels.
Severity: Minor
Found in packages/kirki-framework/control-repeater/src/Control/Repeater.php - About 6 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 findFileWithExtension has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    private function findFileWithExtension($class, $ext)
    {
        // PSR-4 lookup
        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;

Severity: Minor
Found in packages/composer/ClassLoader.php - About 6 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 get_mode has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

        public function get_mode( $color ) {

            // Check if value is an array.
            if ( is_array( $color ) ) {
                // Does the array have an 'rgba' key?
Severity: Minor
Found in lib/class-aricolor.php - About 6 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

Method get_word_colors has 149 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        protected function get_word_colors() {
            return array(
                'aliceblue'            => 'F0F8FF',
                'antiquewhite'         => 'FAEBD7',
                'aqua'                 => '00FFFF',
Severity: Major
Found in lib/class-aricolor.php - About 5 hrs to fix

Function RepeaterRow has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

var RepeaterRow = function( rowIndex, container, label, control ) {
    var self        = this;
    this.rowIndex   = rowIndex;
    this.container  = container;
    this.label      = label;
Severity: Minor
Found in packages/kirki-framework/control-repeater/src/control.js - About 5 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

Severity
Category
Status
Source
Language