CaffGeek/MBACNationals

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

Summary

Maintainability
C
1 day
Test Coverage

Function wp_list_authors has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
Open

function wp_list_authors($args = '') {
    global $wpdb;

    $defaults = array(
        'optioncount' => false, 'exclude_admin' => true,
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/author-template.php - About 1 day 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_authors has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function wp_list_authors($args = '') {
    global $wpdb;

    $defaults = array(
        'optioncount' => false, 'exclude_admin' => true,
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/author-template.php - About 2 hrs to fix

    Function get_author_posts_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    function get_author_posts_url($author_id, $author_nicename = '') {
        global $wp_rewrite;
        $auth_ID = (int) $author_id;
        $link = $wp_rewrite->get_author_permastruct();
    
    
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/author-template.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

    There are no issues that match your filters.

    Category
    Status