lightspeeddevelopment/lsx-customizer

View on GitHub

Showing 2 of 18,317 total issues

Function my_account_menu_item has a Cognitive Complexity of 39 (exceeds 25 allowed). Consider refactoring.
Open

        public function my_account_menu_item( $items, $args ) {
            $my_account_menu_item_position = apply_filters( 'lsx_wc_my_account_menu_item_position', 'primary' );

            if ( $my_account_menu_item_position === $args->theme_location || ( 'primary_logged_out' === $args->theme_location && 'primary' === $my_account_menu_item_position ) ) {
                $customizer_option  = get_theme_mod( 'lsx_wc_my_account_menu_item', false );
Severity: Minor
Found in classes/class-lsx-customizer-woocommerce.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

Consider simplifying this complex logical expression.
Open

                    if (
                        ((a.animating = !0),
                        (a.animatingTo = e),
                        t && a.pause(),
                        a.vars.before(a),
Severity: Critical
Found in assets/js/jquery.flexslider.min.js - About 1 hr to fix
    Severity
    Category
    Status
    Source
    Language