CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function rename has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function rename($from, $to) {
        if(!$this->_exec("RNFR ".$from, "rename")) return FALSE;
        if(!$this->_checkCode()) return FALSE;
        if($this->_code==350) {
            if(!$this->_exec("RNTO ".$to, "rename")) return FALSE;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.php - About 45 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 chmod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function chmod($file, $mode = false, $recursive = false ) {

        if ( ! $mode ) {
            if ( $this->is_file($file) )
                $mode = FS_CHMOD_FILE;

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

    function abort() {
        if(!$this->_exec("ABOR", "abort")) return FALSE;
        if(!$this->_checkCode()) {
            if($this->_code!=426) return FALSE;
            if(!$this->_readmsg("abort")) return FALSE;
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.php - About 45 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 bulk_upgrade has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function bulk_upgrade($plugins) {

        $this->init();
        $this->bulk = true;
        $this->upgrade_strings();
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-upgrader.php - About 45 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

Method wp_category_checklist has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 45 mins to fix

    Method _wp_get_comment_list has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 45 mins to fix

      Function gethchmod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          function gethchmod($file){
              $perms = $this->getchmod($file);
              if (($perms & 0xC000) == 0xC000) // Socket
                  $info = 's';
              elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-filesystem-base.php - About 45 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_views has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          function get_views() {
              global $post_id, $comment_status, $comment_type;
      
              $status_links = array();
              $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_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

      Method add_utility_page has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

        Function column_author has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            function column_author( $comment ) {
                global $comment_status;
        
                $author_url = get_comment_author_url();
                if ( 'http://' == $author_url )

        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

        Method add_submenu_page has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

          Function wp_ajax_send_link_to_editor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          function wp_ajax_send_link_to_editor() {
              check_ajax_referer( 'media-send-to-editor', 'nonce' );
          
              if ( ! $src = wp_unslash( $_POST['src'] ) )
                  wp_send_json_error();
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php - About 45 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

          Method add_object_page has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

            Function wp_ajax_set_post_thumbnail has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function wp_ajax_set_post_thumbnail() {
                $json = ! empty( $_REQUEST['json'] ); // New-style request
            
                $post_ID = intval( $_POST['post_id'] );
                if ( ! current_user_can( 'edit_post', $post_ID ) )
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php - About 45 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_bulk_actions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                function get_bulk_actions() {
                    global $comment_status;
            
                    $actions = array();
                    if ( in_array( $comment_status, array( 'all', 'approved' ) ) )

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

                function prepare_query() {
                    global $wpdb;
                    $this->first_user = ($this->page - 1) * $this->users_per_page;
            
                    $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/includes/deprecated.php - About 45 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

            Avoid deeply nested control flow statements.
            Open

                                    if ( substr($subfile, -4) == '.php' )
                                        $plugin_files[] = "$file/$subfile";
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-admin/includes/plugin.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ( is_null( $parent ) )
                                              break;
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-posts-list-table.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ( !isset( $parent_name ) ) {
                                                /** This filter is documented in wp-includes/post-template.php */
                                                $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
                                            }
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-posts-list-table.php - About 45 mins to fix

                  Function win_is_writable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function win_is_writable($path) {
                      /* will work in despite of Windows ACLs bug
                       * NOTE: use a trailing slash for folders!!!
                       * see http://bugs.php.net/bug.php?id=27609
                       * see http://bugs.php.net/bug.php?id=30931
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/misc.php - About 45 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

                  Severity
                  Category
                  Status
                  Source
                  Language