wp-bootstrap/wp-bootstrap-gallery

View on GitHub
wp-bootstrap-gallery.php

Summary

Maintainability
C
1 day
Test Coverage

Method wp_bootstrap_gallery has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function wp_bootstrap_gallery( $content, $attr ) {
    global $instance, $post;
    $instance++;

    if ( isset( $attr['orderby'] ) ) {
Severity: Major
Found in wp-bootstrap-gallery.php - About 4 hrs to fix

    Function wp_bootstrap_gallery has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php - About 3 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

    The function wp_bootstrap_gallery() has 155 lines of code. Current threshold is set to 100. Avoid really long methods.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    The function wp_bootstrap_gallery() has an NPath complexity of 8064. The configured NPath complexity threshold is 200.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    NPathComplexity

    Since: 0.1

    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

    Example

    class Foo {
        function bar() {
            // lots of complicated code
        }
    }

    Source https://phpmd.org/rules/codesize.html#npathcomplexity

    The function wp_bootstrap_gallery() has a Cyclomatic Complexity of 21. The configured cyclomatic complexity threshold is 10.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

    Avoid using undefined variables such as '$order' which will lead to PHP notices.
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$order' which will lead to PHP notices.
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$order' which will lead to PHP notices.
    Open

        if ( 'RAND' === $order ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$order' which will lead to PHP notices.
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$size' which will lead to PHP notices.
    Open

                $output .= wp_get_attachment_link( $att_id, $size, true ) . "\n";
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Avoid using undefined variables such as '$size' which will lead to PHP notices.
    Open

        $size_class    = sanitize_html_class( $size );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    The method wp_bootstrap_gallery uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

        } else {
    
            $attachments = get_children( array(
                'post_parent'        => $id,
                'post_status'        => 'inherit',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method wp_bootstrap_gallery uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $attachment_count++;
            }
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid unused parameters such as '$content'.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

    Avoid unused local variables such as '$attachment_image'.
    Open

            $attachment_image = wp_get_attachment_image( $id, 'full' );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Avoid unused local variables such as '$size_class'.
    Open

        $size_class    = sanitize_html_class( $size );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Avoid unused local variables such as '$float'.
    Open

        $float        = (is_rtl()) ? 'right' : 'left';
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Avoid variables with short names like $id. Configured minimum length is 3.
    Open

        $id = intval( $id );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    Array double arrow not aligned correctly; expected 7 space(s) between "'size'" and double arrow, but found 10.
    Open

            'size'            => 'thumbnail',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_parent'        => $id,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

        $float        = (is_rtl()) ? 'right' : 'left';
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

        $selector    = "gallery-{$instance}";
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

        $size_class    = sanitize_html_class( $size );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'include'        => '',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 6 space(s) between "'post_type'" and double arrow, but found 9.
    Open

                'post_type'            => 'attachment',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 1 space(s) between "'post_mime_type'" and double arrow, but found 4.
    Open

                'post_mime_type'    => 'image',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

        $output        = "<div class='row' id='$selector'>";
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                break;
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

            case 3:
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                $span_array = array( 8,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 6,6,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'post_status'" and double arrow, but found 7.
    Open

                'post_status'        => 'inherit',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

        $captiontag    = tag_escape( $captiontag );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'orderby'        => 'menu_order ID',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "6"; 0 found
    Open

                $span_array = array( 6,6 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_status'        => 'inherit',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 6 space(s) between "'order'" and double arrow, but found 9.
    Open

            'order'            => 'ASC',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 6,6,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 6 space(s) between "'post_type'" and double arrow, but found 9.
    Open

                'post_type'            => 'attachment',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'icontag'" and double arrow, but found 7.
    Open

            'icontag'        => 'div',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'captiontag'    => 'figcaption',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 8 space(s) between "'orderby'" and double arrow, but found 11.
    Open

                'orderby'            => $orderby,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_status'        => 'inherit',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                /* Two half width images. */
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                /* One full width image with three 1/3 width images underneath. */
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 8 space(s) between "'orderby'" and double arrow, but found 11.
    Open

                'orderby'            => $orderby,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'post_status'" and double arrow, but found 7.
    Open

                'post_status'        => 'inherit',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 12,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 1 space(s) between "'post_mime_type'" and double arrow, but found 4.
    Open

                'post_mime_type'    => 'image',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "6"; 0 found
    Open

                $span_array = array( 12,6,6,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "6"; 0 found
    Open

                $span_array = array( 6,6,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 6,6,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                /* One full width image with two 1/2 width images underneath. All remaining images 1/3 width underneath. */
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                $span_array = array( 12,6,6,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                break;
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    extract() usage is highly discouraged, due to the complexity and unintended issues it might cause.
    Open

        extract( shortcode_atts( array(
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 1 space(s) between "'captiontag'" and double arrow, but found 4.
    Open

            'captiontag'    => 'figcaption',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_type'            => 'attachment',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'post_parent'" and double arrow, but found 7.
    Open

                'post_parent'        => $id,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_type'            => 'attachment',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

        $columns    = intval( min( array( 8, $columns ) ) );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                $span_array = array( 6,6 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 12,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'orderby'            => $orderby,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 8 space(s) between "'orderby'" and double arrow, but found 11.
    Open

                'orderby'            => $orderby,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                $span_array = array( 12,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

            case 5:
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                break;
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'orderby'" and double arrow, but found 7.
    Open

            'orderby'        => 'menu_order ID',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 9 space(s) between "'id'" and double arrow, but found 12.
    Open

            'id'            => $post->ID,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_status'        => 'inherit',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 12,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                $span_array = array( 6,6,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'itemtag'        => 'figure',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 8 space(s) between "'include'" and double arrow, but found 11.
    Open

                'include'            => $include,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 6 space(s) between "'post_type'" and double arrow, but found 9.
    Open

                'post_type'            => 'attachment',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                /* One 2/3 width image with two 1/3 width images to the right, and three 1/3 width images underneath. */
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'id'            => $post->ID,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

        $itemtag    = tag_escape( $itemtag );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'columns'" and double arrow, but found 7.
    Open

            'columns'        => 3,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                break;
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'include'            => $include,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

            case 2:
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_mime_type'    => 'image',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 8,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 8 space(s) between "'exclude'" and double arrow, but found 11.
    Open

                'exclude'            => $exclude,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "6"; 0 found
    Open

                $span_array = array( 12,6,6,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                /* One 3/4 width image with two 1/4 width images to the right. */
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
    Open

            $attachment_link = wp_get_attachment_link( $id, 'full', ! ( isset( $attr['link'] ) and 'file' === $attr['link'] ) );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 8,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'exclude'        => '',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'post_status'" and double arrow, but found 7.
    Open

                'post_status'        => 'inherit',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'exclude'            => $exclude,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 1 space(s) between "'post_mime_type'" and double arrow, but found 4.
    Open

                'post_mime_type'    => 'image',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 10 space(s) between "'order'" and double arrow, but found 13.
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space after open parenthesis; 0 found
    Open

        $float        = (is_rtl()) ? 'right' : 'left';
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 8,4,4,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 8,4,4,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'order'            => 'ASC',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'orderby'            => $orderby,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                $span_array = array( 8,4,4,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Please spell "WordPress" correctly. Found 1 misspelling(s): Wordpress
    Open

     * Description: A custom Wordpress gallery for dynamic thumbnail layout using Twitter Bootstrap 2 thumbnail layouts.
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'include'" and double arrow, but found 7.
    Open

            'include'        => '',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 10 space(s) between "'order'" and double arrow, but found 13.
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'orderby'            => $orderby,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_mime_type'    => 'image',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'post_parent'" and double arrow, but found 7.
    Open

                'post_parent'        => $id,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_mime_type'    => 'image',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space before close parenthesis; 0 found
    Open

        $float        = (is_rtl()) ? 'right' : 'left';
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

            case 4:
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                break;
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'icontag'        => 'div',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                /* Two half width images with fout 1/4 width images underneath. */
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'exclude'" and double arrow, but found 7.
    Open

            'exclude'        => '',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 8,4,4,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 8,4,4,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_type'            => 'attachment',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 10 space(s) between "'order'" and double arrow, but found 13.
    Open

                'order'                => $order,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                $span_array = array( 12 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

            case 6:
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 8,4,4,4,4,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Expected 1 space between comma and "4"; 0 found
    Open

                $span_array = array( 12,6,6,4 );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Array double arrow not aligned correctly; expected 4 space(s) between "'itemtag'" and double arrow, but found 7.
    Open

            'itemtag'        => 'figure',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'columns'        => 3,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

            'size'            => 'thumbnail',
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Spaces must be used for mid-line alignment; tabs are not allowed
    Open

                'post_parent'        => $id,
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                break;
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

                break;
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Tabs must be used to indent lines; spaces are not allowed
    Open

            default:
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    Logical operator "and" is prohibited; use "&&" instead
    Open

            $attachment_link = wp_get_attachment_link( $id, 'full', ! ( isset( $attr['link'] ) and 'file' === $attr['link'] ) );
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpcodesniffer

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $_attachments is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_count is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $_attachments is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_count is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_link is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $_attachments is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $att_id is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $size_class is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_count is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_count is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_count is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_image is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $attachment_link is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $att_id is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $span_array is not named in camelCase.
    Open

    function wp_bootstrap_gallery( $content, $attr ) {
        global $instance, $post;
        $instance++;
    
        if ( isset( $attr['orderby'] ) ) {
    Severity: Minor
    Found in wp-bootstrap-gallery.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status