CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

    function single_row_columns( $item ) {
        list( $columns, $hidden ) = $this->get_column_info();

        foreach ( $columns as $column_name => $column_display_name ) {
            $class = "class='$column_name column-$column_name'";
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.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 delete_old_plugin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
        global $wp_filesystem;

        if ( is_wp_error($removed) )
            return $removed; //Pass errors through.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 after has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function after() {
        if ( empty($this->upgrader->result['destination_name']) )
            return;

        $theme_info = $this->upgrader->theme_info();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 months_dropdown has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function months_dropdown( $post_type ) {
        global $wpdb, $wp_locale;

        $months = $wpdb->get_results( $wpdb->prepare( "
            SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-list-table.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 upload_is_user_over_quota has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function upload_is_user_over_quota( $echo = true ) {
    if ( get_site_option( 'upload_space_check_disabled' ) )
        return false;

    $space_allowed = get_space_allowed();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ms.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 feedback has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function feedback($string) {
        if ( isset( $this->upgrader->strings[$string] ) )
            $string = $this->upgrader->strings[$string];

        if ( strpos($string, '%') !== false ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader-skins.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 send_confirmation_on_profile_email has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function send_confirmation_on_profile_email() {
    global $errors, $wpdb;
    $current_user = wp_get_current_user();
    if ( ! is_object($errors) )
        $errors = new WP_Error();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ms.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_bulk_actions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function get_bulk_actions() {
        global $status;

        $actions = array();
        if ( 'enabled' != $status )

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

function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
    $overrides = array('test_form'=>false);

    $file = wp_handle_sideload($file_array, $overrides);
    if ( isset($file['error']) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/media.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_post_thumbnail_html has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _wp_post_thumbnail_html( $thumbnail_id = NULL ) {
    global $content_width, $_wp_additional_image_sizes;
    $content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set thumbnail' ) . '</a></p>';

    if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/post.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_crop_image has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
    if ( is_numeric( $src_file ) ) // Handle int as attachment ID
        $src_file = get_attached_file( $src_file );

    $src = wp_load_image( $src_file );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/image.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 upgrade has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function upgrade($current) {
        global $wp_filesystem;

        $this->init();
        $this->upgrade_strings();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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 upgrade_110 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function upgrade_110() {
    global $wpdb;

    // Set user_nicename.
    $users = $wpdb->get_results("SELECT ID, user_nickname, user_nicename FROM $wpdb->users");
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/upgrade.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_list_table has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function _get_list_table( $class, $args = array() ) {
    $core_classes = array(
        //Site Admin
        'WP_Posts_List_Table' => 'posts',
        'WP_Media_List_Table' => 'media',
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/list-table.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 after has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function after() {
        if ( $this->upgrader->bulk )
            return;

        $this->plugin = $this->upgrader->plugin_info();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.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_ajax_dim_comment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_dim_comment() {
    $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;

    if ( !$comment = get_comment( $id ) ) {
        $x = new WP_Ajax_Response( array(
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 dispatch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function dispatch() {
        if (empty ($_GET['step']))
            $step = 0;
        else
            $step = (int) $_GET['step'];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/mt.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_ajax_add_tag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_add_tag() {
    global $wp_list_table;

    check_ajax_referer( 'add-tag', '_wpnonce_add-tag' );
    $post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.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 fetch_remote_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function fetch_remote_file($post, $url) {
        $upload = wp_upload_dir($post['post_date']);

        // extract the file name and extension from the url
        $file_name = basename($url);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/wordpress.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 rmdir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function rmdir($path, $recursive = false) {
        //Currently unused and untested, Use delete() instead.
        if ( ! $recursive )
            return @rmdir($path);
        //recursive:

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