aristath/kirki

View on GitHub

Showing 644 of 644 total issues

Function set_settings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function set_settings() {

        // If settings is not an array, temporarily convert it to an array.
        // This is just to allow us to process everything the same way and avoid code duplication.
        // if settings is not an array then it will not be set as an array in the end.
Severity: Minor
Found in packages/kirki-framework/compatibility/src/Field.php - About 25 mins 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 enqueue_styles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function enqueue_styles() {

        $args = array(
            'action' => apply_filters( 'kirki_styles_action_handle', self::$css_handle ),
        );
Severity: Minor
Found in packages/kirki-framework/module-css/src/CSS.php - About 25 mins 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_color_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function sanitize_color_string( $value ) {

        /**
         * This pattern will check and match 3/6/8-character hex, rgb, rgba, hsl, hsla, hsv, and hsva colors.
         *

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

    protected function get_path() {
        $path_found = false;
        $found_path = null;
        foreach ( $this->get_paths() as $path ) {
            if ( $path_found ) {
Severity: Minor
Found in packages/kirki-framework/l10n/src/L10n.php - About 25 mins 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