CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function wp_ajax_add_menu_item has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_add_menu_item() {
    check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );

    if ( ! current_user_can( 'edit_theme_options' ) )
        wp_die( -1 );
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_order has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_save_attachment_order() {
    if ( ! isset( $_REQUEST['post_id'] ) )
        wp_send_json_error();

    if ( ! $post_id = absint( $_REQUEST['post_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 set_screen_options has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function set_screen_options() {

    if ( isset($_POST['wp_screen_options']) && is_array($_POST['wp_screen_options']) ) {
        check_admin_referer( 'screen-options-nonce', 'screenoptionnonce' );

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

function load_image_to_edit($post_id, $mime_type, $size = 'full') {
    $filepath = get_attached_file($post_id);

    if ( $filepath && file_exists($filepath) ) {
        if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/image-edit.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 _data_read has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    function _data_read($mode=FTP_ASCII, $fp=NULL) {
        $NewLine=$this->_eol_code[$this->OS_local];
        if(is_resource($fp)) $out=0;
        else $out="";
        if(!$this->_passive) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp-sockets.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 admin_page has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    function admin_page() {
?>
<div class="wrap" id="custom-background">
<h2><?php _e( 'Custom Background' ); ?></h2>

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

function press_it() {
    // define some basic variables
    $quick['post_status'] = 'draft'; // set as draft first
    $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
    $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/press-this.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 redirect_page has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function redirect_page($page_ID) {
    global $action;

    $referredby = '';
    if ( !empty($_POST['referredby']) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/page.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 show_blog_form has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
    $current_site = get_current_site();
    // Blog name
    if ( !is_subdomain_install() )
        echo '<label for="blogname">' . __('Site Name:') . '</label>';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-signup.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 retrieve_password has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function retrieve_password() {
    global $wpdb;

    $errors = new WP_Error();

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

function wp_allow_comment($commentdata) {
    global $wpdb;
    extract($commentdata, EXTR_SKIP);

    // Simple duplicate check
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 twentytwelve_body_class has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function twentytwelve_body_class( $classes ) {
    $background_color = get_background_color();
    $background_image = get_background_image();

    if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.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 twentyfourteen_the_attached_image has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function twentyfourteen_the_attached_image() {
    $post                = get_post();
    /**
     * Filter the default Twenty Fourteen attachment size.
     *

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

function twentythirteen_the_attached_image() {
    /**
     * Filter the image attachment size to use.
     *
     * @since Twenty thirteen 1.0

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

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

    $defaults = array('status' => '', 'orderby' => 'comment_date_gmt', 'order' => 'DESC', 'number' => '', 'offset' => '', 'post_id' => 0);

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

    function wp_editComment($args) {
        $this->escape($args);

        $blog_id    = (int) $args[0];
        $username    = $args[1];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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_getTerms has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    function wp_getTerms( $args ) {
        if ( ! $this->minimum_args( $args, 4 ) )
            return $this->error;

        $this->escape( $args );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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_enclosure_if_new has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    function add_enclosure_if_new( $post_ID, $enclosure ) {
        if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
            $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] . "\n";
            $found = false;
            if ( $enclosures = get_post_meta( $post_ID, 'enclosure' ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 _prepare_post has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _prepare_post( $post, $fields ) {
        // holds the data for this post. built up based on $fields
        $_post = array( 'post_id' => strval( $post['ID'] ) );

        // prepare common post fields
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.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 sanitize_term has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function sanitize_term($term, $taxonomy, $context = 'display') {

    if ( 'raw' == $context )
        return $term;

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