CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/bookmark-template.php

Summary

Maintainability
C
1 day
Test Coverage

Function _walk_bookmarks has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

function _walk_bookmarks($bookmarks, $args = '' ) {
    $defaults = array(
        'show_updated' => 0, 'show_description' => 0,
        'show_images' => 1, 'show_name' => 0,
        'before' => '<li>', 'after' => '</li>', 'between' => "\n",
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/bookmark-template.php - About 5 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

Method _walk_bookmarks has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function _walk_bookmarks($bookmarks, $args = '' ) {
    $defaults = array(
        'show_updated' => 0, 'show_description' => 0,
        'show_images' => 1, 'show_name' => 0,
        'before' => '<li>', 'after' => '</li>', 'between' => "\n",
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/bookmark-template.php - About 2 hrs to fix

    Function wp_list_bookmarks has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    function wp_list_bookmarks($args = '') {
        $defaults = array(
            'orderby' => 'name', 'order' => 'ASC',
            'limit' => -1, 'category' => '', 'exclude_category' => '',
            'category_name' => '', 'hide_invisible' => 1,
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/bookmark-template.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

    Method wp_list_bookmarks has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function wp_list_bookmarks($args = '') {
        $defaults = array(
            'orderby' => 'name', 'order' => 'ASC',
            'limit' => -1, 'category' => '', 'exclude_category' => '',
            'category_name' => '', 'hide_invisible' => 1,
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/bookmark-template.php - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status