CaffGeek/MBACNationals

View on GitHub

Showing 5,566 of 7,504 total issues

Method wp_insert_term has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function wp_insert_term( $term, $taxonomy, $args = array() ) {
    global $wpdb;

    if ( ! is_taxonomy($taxonomy) )
        return new WP_Error('invalid_taxonomy', __('Invalid taxonomy'));
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/taxonomy.php - About 2 hrs to fix

    Method Analyze has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function Analyze() {
            $info = &$this->getid3->info;
    
            if (!getid3_lib::intValueSupported($info['filesize'])) {
                $info['warning'][] = 'Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB';
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.tag.id3v1.php - About 2 hrs to fix

      Method start_element has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function start_element($parser, $name, $attrs) {
      
              $tag = array_pop(split(":", $name));
      
              switch($name) {
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 2 hrs to fix

        Function insertMedia has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function insertMedia() {
            var fe, f = document.forms[0], h;
        
            tinyMCEPopup.restoreSelection();
        
        

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

          finishDrag: function(event, success) {
            this.dragging = false;
            
            if(this.options.quiet){
              Position.prepare();
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js - 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 uploadCompleteHandler has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            SWFUpload.queue.uploadCompleteHandler = function (file) {
                var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
                var continueUpload;
                
                if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {

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

          onEmptyHover: function(element, dropon, overlap) {
            var oldParentNode = element.parentNode;
            var droponOptions = Sortable.options(dropon);
                
            if(!Element.isParent(dropon, element)) {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js - 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_dashboard_recent_comments_row has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
            $GLOBALS['comment'] =& $comment;
        
            $comment_post_url = get_edit_post_link( $comment->comment_post_ID );
            $comment_post_title = strip_tags(get_the_title( $comment->comment_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 get_media_items has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function get_media_items( $post_id, $errors ) {
            if ( $post_id ) {
                $post = get_post($post_id);
                if ( $post && $post->post_type == 'attachment' )
                    $attachments = array($post->ID => $post);
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/media.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 prepare_items has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            function prepare_items() {
                include( ABSPATH . 'wp-admin/includes/plugin-install.php' );
        
                global $tabs, $tab, $paged, $type, $term;
        
        

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

        function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
            global $wpdb, $post_ID;
            $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
        
            if ( $items ) {
        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 screen_options has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function screen_options($screen) {
            switch ( $screen ) {
                case 'edit':
                    $per_page_label = __('Posts per page:');
                    break;
        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 get_sample_permalink_html has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
            $post = &get_post($id);
            list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
        
            if ( 'publish' == $post->post_status ) {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/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

        Function wp_nav_menu_item_taxonomy_meta_box has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
            global $nav_menu_selected_id;
            $taxonomy_name = $taxonomy['args']->name;
        
            // paginate browsing for large numbers of objects
        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_ajax_inline_save has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_ajax_inline_save() {
            global $wp_list_table;
        
            check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
        
        
        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 wp_ajax_inline_save_tax has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_ajax_inline_save_tax() {
            global $wp_list_table;
        
            check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
        
        
        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 wp_ajax_widgets_order has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function wp_ajax_widgets_order() {
            check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
        
            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 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 prepare_items has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            function prepare_items() {
                include( ABSPATH . 'wp-admin/includes/theme-install.php' );
        
                global $tabs, $tab, $paged, $type, $theme_field_defaults;
                wp_reset_vars( array( 'tab' ) );

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

            public static function transition_comment_status( $new_status, $old_status, $comment ) {
                if ( $new_status == $old_status )
                    return;
        
                # we don't need to record a history item for deleted comments

        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