CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function wp_ajax_autocomplete_user has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_autocomplete_user() {
    if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) )
        wp_die( -1 );

    /** This filter is documented in wp-admin/user-new.php */
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 delete has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    function delete($file, $recursive = false) {
        if ( empty($file) ) //Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
            return false;
        $file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise

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

    function chmod($file, $mode = false, $recursive = false) {
        if ( ! $this->exists($file) )
            return false;

        if ( ! $mode ) {

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

function wp_ajax_save_attachment_compat() {
    if ( ! isset( $_REQUEST['id'] ) )
        wp_send_json_error();

    if ( ! $id = absint( $_REQUEST['id'] ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 add_submenu_page has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) {
    global $submenu;
    global $menu;
    global $_wp_real_parent_file;
    global $_wp_submenu_nopriv;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.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 do_paging has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    function do_paging() {
        if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
            $args = array();
            if( ! empty($this->search_term) )
                $args['usersearch'] = urlencode($this->search_term);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/deprecated.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 get_plugin_page_hookname has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function get_plugin_page_hookname( $plugin_page, $parent_page ) {
    global $admin_page_hooks;

    $parent = get_admin_page_parent( $parent_page );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.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 wp_ajax_find_posts has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_find_posts() {
    global $wpdb;

    check_ajax_referer( 'find-posts' );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 wp_ajax_save_attachment has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_save_attachment() {
    if ( ! isset( $_REQUEST['id'] ) || ! isset( $_REQUEST['changes'] ) )
        wp_send_json_error();

    if ( ! $id = absint( $_REQUEST['id'] ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 deactivate_plugins has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function deactivate_plugins($plugins, $silent= false) {
    $current = get_option('active_plugins');

    if ( !is_array($plugins) )
        $plugins = array($plugins);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.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 xfn_check has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function xfn_check($class, $value = '', $deprecated = '') {
    global $link;

    $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
    $rels = preg_split('/\s+/', $link_rel);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/meta-boxes.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 import_post has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    function import_post( $post ) {
        global $wpdb;

        // Make sure we haven't already imported this one
        if ( $this->get_wp_post_ID( $post['itemid'] ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/livejournal.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 add_menu_classes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function add_menu_classes($menu) {

    $first = $lastorder = false;
    $i = 0;
    $mc = count($menu);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/menu.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 ns_to_prefix has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    function ns_to_prefix($qname) {
        $components = split(":", $qname);
        $name = array_pop($components);

        if(!empty($components)) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.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 import_post has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    function import_post( $entry ) {
        global $importing_blog;

        // The old permalink is all Blogger gives us to link comments to their posts.
        if ( isset( $entry->draft ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.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 _wp_ajax_delete_comment_response has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function _wp_ajax_delete_comment_response( $comment_id ) {
    $total = (int) @$_POST['_total'];
    $per_page = (int) @$_POST['_per_page'];
    $page = (int) @$_POST['_page'];
    $url = esc_url_raw( @$_POST['_url'] );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/admin-ajax.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 twentyfourteen_body_classes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function twentyfourteen_body_classes( $classes ) {
    if ( is_multi_author() ) {
        $classes[] = 'group-blog';
    }

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

function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {
    global $wp_query;

    if ( null === $comments && null === $per_page && null === $threaded && !empty($wp_query->max_num_comment_pages) )
        return $wp_query->max_num_comment_pages;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.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 discover_pingback_server_uri has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function discover_pingback_server_uri($url, $deprecated = 2048) {

    $pingback_str_dquote = 'rel="pingback"';
    $pingback_str_squote = 'rel=\'pingback\'';

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/comment.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 twentythirteen_entry_meta has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function twentythirteen_entry_meta() {
    if ( is_sticky() && is_home() && ! is_paged() )
        echo '<span class="featured-post">' . __( 'Sticky', 'twentythirteen' ) . '</span>';

    if ( ! has_post_format( 'link' ) && 'post' == get_post_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

Severity
Category
Status
Source
Language