CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

    function comments2wp($comments='')
    {
        // General Housekeeping
        global $wpdb;
        $count = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.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

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

    function insert_postmeta( $post_id, $post ) {
        // Need the original LJ id for comments
        add_post_meta( $post_id, 'lj_itemid', $post['itemid'] );

        // And save the permalink on LJ in case we want to link back or something
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/livejournal.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

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

    function get_feed($page = 1, $post_type = 'post') {
        global $post, $wp, $wp_query, $posts, $wpdb, $blog_id;
        log_app('function',"get_feed($page, '$post_type')");
        ob_start();

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-app.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

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

    function get_file($postID) {

        // check for not found
        global $entry;
        $this->set_current_entry($postID);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-app.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

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

    function get_entry($postID, $post_type = 'post') {
        log_app('function',"get_entry($postID, '$post_type')");
        ob_start();
        switch($post_type) {
            case 'post':
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-app.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

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

    function blogger_editPost($args) {

        $this->escape($args);

        $post_ID     = (int) $args[1];
Severity: Minor
Found in Web.Admin/2014/wordpress/xmlrpc.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

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

    function blogger_getRecentPosts($args) {

        $this->escape($args);

        $blog_ID    = (int) $args[1]; /* though we don't use it yet */
Severity: Minor
Found in Web.Admin/2014/wordpress/xmlrpc.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

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

    public static function display_status() {
        $servers    = self::get_server_connectivity();
        $fail_count = count( $servers ) - count( array_filter( $servers ) );
        $type       = '';

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 twentyfourteen_paging_nav has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function twentyfourteen_paging_nav() {
    // Don't print empty markup if there's only one page.
    if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
        return;
    }

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 akismet_spam_comments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function akismet_spam_comments( $type = false, $page = 1, $per_page = 50 ) {
    global $wpdb;

    $page = (int) $page;
    if ( $page < 2 )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.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

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

    public static function rightnow_stats() {
        global $submenu, $wp_db_version;

        if ( 8645 < $wp_db_version  ) // 2.7
            $link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) );

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 akismet_rightnow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function akismet_rightnow() {
    global $submenu, $wp_db_version;

    if ( 8645 < $wp_db_version  ) // 2.7
        $link = 'edit-comments.php?comment_status=spam';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.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

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

function akismet_check_server_connectivity() {
    global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
    
    $test_host = 'rest.akismet.com';
    
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.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

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

function wp_delete_comment($comment_id) {
    global $wpdb;
    if (!$comment = get_comment($comment_id))
        return false;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.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

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

function wp_get_comment_status($comment_id) {
    $comment = get_comment($comment_id);
    if ( !$comment )
        return false;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.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

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

    public static function disable_moderation_emails_if_unreachable( $emails, $comment_id ) {
        if ( ! empty( self::$prevent_moderation_email_for_these_comments ) && ! empty( $emails ) ) {
            $comment = get_comment( $comment_id );

            foreach ( self::$prevent_moderation_email_for_these_comments as $possible_match ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/class.akismet.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

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

function twentythirteen_header_style() {
    $header_image = get_header_image();
    $text_color   = get_header_textcolor();

    // If no custom options for text are set, let's bail.

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 get_comment_count has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function get_comment_count( $post_id = 0 ) {
    global $wpdb;

    $post_id = (int) $post_id;

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.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

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

    public static function check_server_connectivity() {
        $test_host = 'rest.akismet.com';

        // Some web hosts may disable one or both functions
        if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') )

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 admin_help has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function admin_help() {
        $current_screen = get_current_screen();

        // Screen Content
        if ( current_user_can( 'manage_options' ) ) {

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