CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

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

function populate_roles_210() {
    $roles = array('administrator', 'editor');
    foreach ($roles as $role) {
        $role =& get_role($role);
        if ( empty($role) )
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.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 activate_plugins has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function activate_plugins($plugins, $redirect = '') {
    if ( !is_array($plugins) )
        $plugins = array($plugins);

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

    function comments2wp($comments='')
    {
        // General Housekeeping
        global $wpdb;
        $count = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/textpattern.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 comments2wp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function comments2wp($comments='')
    {
        // General Housekeeping
        global $wpdb;
        $count = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.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 insert_postmeta has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function insert_postmeta( $post_id, $post ) {
        // Need the original LJ id for comments
        add_post_meta( $post_id, 'lj_itemid', $post['itemid'] );

        // And save the permalink on LJ in case we want to link back or something
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/livejournal.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 import_comment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function import_comment( $entry ) {
        global $importing_blog;

        // Drop the #fragment and we have the comment's old post permalink.
        foreach ( $entry->links as $link ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/blogger.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 cat2wp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function cat2wp($categories='')
    {
        // General Housekeeping
        global $wpdb;
        $count = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/textpattern.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/stp.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 links2wp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function links2wp($links='')
    {
        // General Housekeeping
        global $wpdb;
        $count = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/textpattern.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 process_categories has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function process_categories() {
        global $wpdb;

        $cat_names = (array) get_terms('category', 'fields=names');

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

    function cat2wp($categories='')
    {
        // General Housekeeping
        global $wpdb;
        $count = 0;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/import/dotclear.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_feed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function get_feed($page = 1, $post_type = 'post') {
        global $post, $wp, $wp_query, $posts, $wpdb, $blog_id;
        log_app('function',"get_feed($page, '$post_type')");
        ob_start();

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

function wp_delete_comment($comment_id) {
    global $wpdb;
    if (!$comment = get_comment($comment_id))
        return false;

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

function akismet_check_server_connectivity() {
    global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
    
    $test_host = 'rest.akismet.com';
    
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.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 rightnow_stats has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function rightnow_stats() {
        global $submenu, $wp_db_version;

        if ( 8645 < $wp_db_version  ) // 2.7
            $link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.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 check_server_connectivity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function check_server_connectivity() {
        $test_host = 'rest.akismet.com';

        // Some web hosts may disable one or both functions
        if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') )

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

function get_comment_count( $post_id = 0 ) {
    global $wpdb;

    $post_id = (int) $post_id;

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

function akismet_rightnow() {
    global $submenu, $wp_db_version;

    if ( 8645 < $wp_db_version  ) // 2.7
        $link = 'edit-comments.php?comment_status=spam';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.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 widget_akismet_control has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function widget_akismet_control() {
        $options = $newoptions = get_option('widget_akismet');
        if ( $_POST["akismet-submit"] ) {
            $newoptions['title'] = strip_tags(stripslashes($_POST["akismet-title"]));
            if ( empty($newoptions['title']) ) $newoptions['title'] = 'Spam Blocked';
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.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 admin_help has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function admin_help() {
        $current_screen = get_current_screen();

        // Screen Content
        if ( current_user_can( 'manage_options' ) ) {

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