lightspeeddevelopment/lsx

View on GitHub

Showing 5 of 11,403 total issues

Function lsx_get_thumbnail has a Cognitive Complexity of 49 (exceeds 25 allowed). Consider refactoring.
Open

    function lsx_get_thumbnail( $size, $image_src = false ) {
        global $wp_version;

        if ( false === $image_src ) {
            $post_id           = get_the_ID();
Severity: Minor
Found in includes/extras.php - About 4 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 lsx_author_extra_info has a Cognitive Complexity of 35 (exceeds 25 allowed). Consider refactoring.
Open

    function lsx_author_extra_info() {
        $default_size = 'sm';
        $size         = apply_filters( 'lsx_bootstrap_column_size', $default_size );

        if ( is_author() ) :
Severity: Minor
Found in includes/layout.php - About 1 hr 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 lsx_global_header has a Cognitive Complexity of 34 (exceeds 25 allowed). Consider refactoring.
Open

    function lsx_global_header() {
        $show_on_front  = get_option( 'show_on_front' );
        $queried_object = get_queried_object();
        $default_size   = 'sm';
        $size           = apply_filters( 'lsx_bootstrap_column_size', $default_size );
Severity: Minor
Found in includes/layout.php - About 1 hr 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 start_el has a Cognitive Complexity of 30 (exceeds 25 allowed). Consider refactoring.
Open

        public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
            $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';

            /**
             * If this is a default menu being called we need to fix
Severity: Minor
Found in includes/classes/class-lsx-bootstrap-navwalker.php - About 1 hr 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 lsx_sitemap_loops has a Cognitive Complexity of 27 (exceeds 25 allowed). Consider refactoring.
Open

    function lsx_sitemap_loops() {
        $sitemap_loops  = array(
            'page'     => array(
                'type'      => 'post_type',
                'label'     => __( 'Pages', 'lsx' ),
Severity: Minor
Found in includes/template-tags.php - About 35 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