CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function delete_theme has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function delete_theme($template) {
    global $wp_filesystem;

    if ( empty($template) )
        return false;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/theme.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 privMerge has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  function privMerge(&$p_archive_to_add)
  {
    $v_result=1;

    // ----- Look if the archive_to_add exists
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.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 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function get($remotefile, $localfile=NULL, $rest=0) {
        if(is_null($localfile)) $localfile=$remotefile;
        if (@file_exists($localfile)) $this->SendMSG("Warning : local file will be overwritten");
        $fp = @fopen($localfile, "w");
        if (!$fp) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.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 chmod has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function chmod($file, $mode = false, $recursive = false) {
        if ( ! $this->exists($file) && ! $this->is_dir($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 get_alloptions_110 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function get_alloptions_110() {
    global $wpdb;
    if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) {
        foreach ($options as $option) {
            // "When trying to design a foolproof system,
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/upgrade.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_blog has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function set_blog( $blog_id ) {
        if ( is_numeric( $blog_id ) ) {
            $blog_id = (int) $blog_id;
        } else {
            $blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id );
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-importer.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 the_media_upload_tabs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function the_media_upload_tabs() {
    global $redir_tab;
    $tabs = media_upload_tabs();

    if ( !empty($tabs) ) {
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 after has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function after() {
        $this->decrement_update_count( 'theme' );

        $update_actions = array();
        if ( ! empty( $this->upgrader->result['destination_name'] ) && $theme_info = $this->upgrader->theme_info() ) {

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

    function glob_pattern_match($pattern,$string) {
        $out=null;
        $chunks=explode(';',$pattern);
        foreach($chunks as $pattern) {
            $escape=array('$','^','.','{','}','(',')','[',']','|');
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.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 put has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function put($localfile, $remotefile=NULL, $rest=0) {
        if(is_null($remotefile)) $remotefile=$localfile;
        if (!file_exists($localfile)) {
            $this->PushError("put","can't open local file", "No such file or directory \"".$localfile."\"");
            return FALSE;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.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 12 (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/includes/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 wp_delete_user has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function wp_delete_user($id, $reassign = 'novalue') {
    global $wpdb;

    $id = (int) $id;
    $user = new WP_User($id);
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 add_user has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function add_user() {
    if ( func_num_args() ) { // The hackiest hack that ever did hack
        global $current_user, $wp_roles;
        $user_id = (int) func_get_arg( 0 );

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

function wp_ajax_send_attachment_to_editor() {
    check_ajax_referer( 'media-send-to-editor', 'nonce' );

    $attachment = wp_unslash( $_POST['attachment'] );

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

function get_column_headers($page) {
    global $_wp_column_headers;

    if ( !isset($_wp_column_headers) )
        $_wp_column_headers = array();
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_ajax_get_comments has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function wp_ajax_get_comments( $action ) {
    global $wp_list_table, $post_id;
    if ( empty( $action ) )
        $action = 'get-comments';

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

function wp_reset_vars( $vars ) {
    for ( $i=0; $i<count( $vars ); $i += 1 ) {
        $var = $vars[$i];
        global $$var;

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

    function _data_write($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 start has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function start() {
        if ( isset($_POST['restart']) )
            $this->restart();

        $options = get_option('blogger_importer');
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 setup has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    function setup() {
        global $verified;
        // Get details from form or from DB
        if ( !empty( $_POST['lj_username'] ) && !empty( $_POST['lj_password'] ) ) {
            // Store details for later
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