aristath/kirki

View on GitHub

Showing 449 of 644 total issues

Function loadStylesheet has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  DomHelper.prototype.loadStylesheet = function (href, opt_callback, opt_async) {
    var link = this.createElement('link', {
      'rel': 'stylesheet',
      'href': href,
      'media': (opt_async ? 'only x' : 'all')

Function 41 has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

module.exports = function memize( fn, options ) {
    var size = 0,
        maxSize, head, tail;
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 2 hrs to fix

Method get_font_family_choices has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function get_font_family_choices() {

        $args = $this->args;

        // Figure out how to sort the fonts.
Severity: Major
Found in packages/kirki-framework/field-typography/src/Field/Typography.php - About 2 hrs to fix

File ClassLoader.php has 276 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/*
 * This file is part of Composer.
 *
Severity: Minor
Found in packages/composer/ClassLoader.php - About 2 hrs to fix

Function 105 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

},{"42":42}],105:[function(_dereq_,module,exports){
var toInteger = _dereq_(115);
var defined = _dereq_(35);
// true  -> String#at
// false -> String#codePointAt
Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 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 set_js_vars has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected function set_js_vars() {
        if ( ! is_array( $this->js_vars ) ) {
            $this->js_vars = [];
        }

Severity: Minor
Found in packages/kirki-framework/compatibility/src/Field.php - About 2 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 memize has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function memize( fn, options ) {
    var size = 0,
        maxSize, head, tail;

    if ( options && options.maxSize ) {
Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 2 hrs to fix

Method parse_output has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function parse_output() {
        foreach ( $this->output as $output ) {
            $skip = false;

            // Apply any sanitization callbacks defined.
Severity: Major
Found in packages/kirki-framework/module-css/src/CSS/Output.php - About 2 hrs to fix

ClassLoader has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class ClassLoader
{
    /** @var ?string */
    private $vendorDir;

Severity: Minor
Found in packages/composer/ClassLoader.php - About 2 hrs to fix

ariColor has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

    class ariColor {

        /**
         * An array of our instances.
         *
Severity: Minor
Found in lib/class-aricolor.php - About 2 hrs to fix

Function RepeaterRow has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var RepeaterRow = function( rowIndex, container, label, control ) {
    var self        = this;
    this.rowIndex   = rowIndex;
    this.container  = container;
    this.label      = label;
Severity: Major
Found in packages/kirki-framework/control-repeater/src/control.js - About 2 hrs to fix

Function 96 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

},{"25":25}],96:[function(_dereq_,module,exports){
'use strict';

var regexpFlags = _dereq_(44);

Severity: Minor
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 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 sanitize has a Cognitive Complexity of 18 (exceeds 5 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 2 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 init has a Cognitive Complexity of 18 (exceeds 5 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: Minor
Found in packages/kirki-framework/field-dimensions/src/Dimensions.php - About 2 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 set_js_vars has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function set_js_vars() {

        // Typecast to array.
        $this->js_vars = (array) $this->js_vars;

Severity: Minor
Found in packages/kirki-framework/field-background/src/Background.php - About 2 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 field_init has a Cognitive Complexity of 18 (exceeds 5 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 2 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 filter_control_args has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function filter_control_args( $args, $wp_customize ) {
        if ( $args['settings'] === $this->args['settings'] ) {
            $args = parent::filter_control_args( $args, $wp_customize );

            $args['type'] = 'code_editor';
Severity: Minor
Found in packages/kirki-framework/control-code/src/Field/Code.php - About 2 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 process_output has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function process_output( $output, $value ) {

        $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global';
        $output['element']     = ( isset( $output['element'] ) ) ? $output['element'] : 'body';
        $output['prefix']      = ( isset( $output['prefix'] ) ) ? $output['prefix'] : '';

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 61 has 60 lines of code (exceeds 25 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: Major
Found in packages/kirki-framework/compatibility/src/scripts/wp-polyfill.js - About 2 hrs to fix

Function sprintf_parse has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function sprintf_parse(fmt) {
        if (sprintf_cache[fmt]) {
            return sprintf_cache[fmt]
        }

Severity: Major
Found in packages/kirki-framework/compatibility/src/scripts/i18n.js - About 2 hrs to fix
Severity
Category
Status
Source
Language