CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) {
        $count = number_format_i18n( $tag->count );
        $tagsel = ($taxonomy == 'post_tag' ? 'tag' : $taxonomy);
        $count = ( $count > 0 ) ? "<a href='edit.php?$tagsel=$tag->slug'>$count</a>" : $count;

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

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

function get_attachment_fields_to_edit($post, $errors = null) {
    if ( is_int($post) )
        $post =& get_post($post);
    if ( is_array($post) )
        $post = (object) $post;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/media.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 _post_states has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function _post_states($post) {
    $post_states = array();
    if ( isset($_GET['post_status']) )
        $post_status = $_GET['post_status'];
    else
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/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

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

    function WP_Filesystem_ftpsockets($opt = '') {
        $this->method = 'ftpsockets';
        $this->errors = new WP_Error();

        //Check if possible to use ftp functions.

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

    function find_folder($folder) {

        if ( strpos($this->method, 'ftp') !== false ) {
            $constant_overrides = array( 'FTP_BASE' => ABSPATH, 'FTP_CONTENT_DIR' => WP_CONTENT_DIR, 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR );
            foreach ( $constant_overrides as $constant => $dir )

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 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 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 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 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 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 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( $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

Severity
Category
Status
Source
Language