CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function wp_insert_category has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_insert_category($catarr, $wp_error = false) {
    $cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => '');
    $catarr = wp_parse_args($catarr, $cat_defaults);
    extract($catarr, EXTR_SKIP);

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/taxonomy.php - About 2 hrs 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 connect has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function connect($server=NULL) {
        if(!empty($server)) {
            if(!$this->SetServer($server)) return false;
        }
        if($this->_ready) return true;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.php - About 2 hrs 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_save_nav_menu_items has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) {
    $menu_id = (int) $menu_id;
    $items_saved = array();

    if ( 0 == $menu_id || is_nav_menu( $menu_id ) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/nav-menu.php - About 2 hrs 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_SSH2 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

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

        //Check if possible to use ssh2 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_dashboard_quick_press has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_dashboard_quick_press() {
    $drafts = false;
    if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) && (int) $_POST['post_ID'] ) {
        $view = get_permalink( $_POST['post_ID'] );
        $edit = esc_url( get_edit_post_link( $_POST['post_ID'] ) );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/dashboard.php - About 2 hrs 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_plugins_table has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function display_plugins_table($plugins, $page = 1, $totalpages = 1){
    $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
    $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';

    $plugins_allowedtags = array('a' => array('href' => array(),'title' => array(), 'target' => array()),
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin-install.php - About 2 hrs 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 update_core has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function update_core($from, $to) {
    global $wp_filesystem, $_old_files, $wpdb;

    @set_time_limit( 300 );

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/update-core.php - About 2 hrs 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_list has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
    global $wpdb;

    $start = abs( (int) $start );
    $num = (int) $num;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 2 hrs 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_upload_attachment has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_upload_attachment() {
    check_ajax_referer( 'media-form' );

    if ( ! current_user_can( 'upload_files' ) )
        wp_die();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php - About 2 hrs 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 populate_options has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function populate_options() {
    global $wpdb, $wp_db_version;

    $guessurl = wp_guess_url();

Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 2 hrs 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_image_editor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_image_editor($post_id, $msg = false) {
    $nonce = wp_create_nonce("image_editor-$post_id");
    $meta = wp_get_attachment_metadata($post_id);
    $thumb = image_get_intermediate_size($post_id, 'thumbnail');
    $sub_sizes = isset($meta['sizes']) && is_array($meta['sizes']);
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/image-edit.php - About 2 hrs 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_views has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function get_views() {
        global $locked_post_status, $avail_post_stati;

        $post_type = $this->screen->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

Function display_start_page has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function display_start_page() {
        if ( isset( $_GET['action'] ) ) {
            if ( $_GET['action'] == 'delete-key' ) {
                if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], self::NONCE ) )
                    delete_option( 'wordpress_api_key' );

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

    function do_item( $handle ) {
        if ( !parent::do_item($handle) )
            return false;

        $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/class.wp-styles.php - About 2 hrs 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_cron has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_cron() {

    // Prevent infinite loops caused by lack of wp-cron.php
    if ( strpos($_SERVER['REQUEST_URI'], '/wp-cron.php') !== false || ( defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ) )
        return;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/cron.php - About 2 hrs 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_newTerm has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function wp_newTerm( $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 2 hrs 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_term has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') {
    global $wpdb;
    $null = null;

    if ( empty($term) ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 2 hrs 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_unique_term_slug has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function wp_unique_term_slug($slug, $term) {
    global $wpdb;

    // If the taxonomy supports hierarchy and the term has a parent, make the slug unique
    // by incorporating parent slugs.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 2 hrs 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_the_taxonomies has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function get_the_taxonomies($post = 0) {
    if ( is_int($post) )
        $post =& get_post($post);
    elseif ( !is_object($post) )
        $post =& $GLOBALS['post'];
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 2 hrs 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_children has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function &get_children($args = '', $output = OBJECT) {
    $kids = array();
    if ( empty( $args ) ) {
        if ( isset( $GLOBALS['post'] ) ) {
            $args = array('post_parent' => (int) $GLOBALS['post']->post_parent );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/post.php - About 2 hrs 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