CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

Function post_submit_meta_box has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
Open

function post_submit_meta_box($post) {
    global $action;

    $post_type = $post->post_type;
    $can_publish = current_user_can("publish_${post_type}s");
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/includes/meta-boxes.php - About 1 day 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 Analyze has 281 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function Analyze() {
        $info = &$this->getid3->info;

        //    Overall tag structure:
        //        +-----------------------------+
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/ID3/module.tag.id3v2.php - About 1 day to fix

    Method init has 279 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function init()
        {
            // Check absolute bare minimum requirements.
            if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.3.0', '<')) || !extension_loaded('xml') || !extension_loaded('pcre'))
            {
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 1 day to fix

      File rss.php has 629 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * MagpieRSS: a simple RSS integration tool
       *
       * A compiled file for RSS syndication
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/rss.php - About 1 day to fix

        Function update has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
        Open

            update : function() {
                var t = this, f = document.forms[0], ed = tinyMCEPopup.editor, el, b, fixSafari = null, DL, P, A, DIV, do_caption = null, img_class = f.img_classes.value, html;
        
                tinyMCEPopup.restoreSelection();
                el = ed.selection.getNode();

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

            public function embed($options = '', $native = false)
            {
                // Set up defaults
                $audio = '';
                $video = '';
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Enclosure.php - About 1 day 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 save has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
        Open

            public function save($data)
            {
                if ($this->mysql === null)
                {
                    return false;
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Cache/MySQL.php - About 1 day 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

        File comment-template.php has 628 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Comment template functions
         *
         * These functions are meant to live inside of the WordPress loop.
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/comment-template.php - About 1 day to fix

          Method akismet_caught has 275 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function akismet_caught() {
              global $wpdb, $comment, $akismet_caught, $akismet_nonce;
          
              akismet_recheck_queue();
              if (isset($_POST['submit']) && 'recover' == $_POST['action'] && ! empty($_POST['not_spam'])) {
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/akismet.php - About 1 day to fix

            File media-audiovideo.js has 621 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* global _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */
            
            (function($, _, Backbone) {
                var media = wp.media,
                    baseSettings = {},
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js - About 1 day to fix

              File media.php has 620 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * WordPress API for media display.
               *
               * @package WordPress
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/media.php - About 1 day to fix

                File deprecated.php has 620 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Deprecated functions from past WordPress versions. You shouldn't use these
                 * globals and functions and look for the alternatives instead. The functions
                 * and globals will be removed in a later version.
                Severity: Major
                Found in Web.Admin/2014/wordpress/wp-includes/deprecated.php - About 1 day to fix

                  Function display_rows has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function display_rows() {
                          global $mode;
                  
                          $alt = '';
                          $super_admins = get_super_admins();

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

                  function kubrick_add_theme_page() {
                      if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) {
                          if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) {
                              check_admin_referer('kubrick-header');
                              if ( isset($_REQUEST['njform']) ) {
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-content/themes/default/functions.php - About 1 day 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_default_scripts has 268 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function wp_default_scripts( &$scripts ) {
                  
                      if ( !$guessurl = site_url() )
                          $guessurl = wp_guess_url();
                  
                  
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/script-loader.php - About 1 day to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            if ( $logged_in ) {
                                $comment['comment_author'] = $wpdb->escape( $user->display_name );
                                $comment['comment_author_email'] = $wpdb->escape( $user->user_email );
                                $comment['comment_author_url'] = $wpdb->escape( $user->user_url );
                                $comment['user_ID'] = $user->ID;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/xmlrpc.php and 1 other location - About 1 day to fix
                    Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 3226..3252

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 301.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            if ( $logged_in ) {
                                $comment['comment_author'] = $this->escape( $user->display_name );
                                $comment['comment_author_email'] = $this->escape( $user->user_email );
                                $comment['comment_author_url'] = $this->escape( $user->user_url );
                                $comment['user_ID'] = $user->ID;
                    Web.Admin/2014/wordpress/xmlrpc.php on lines 1307..1333

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 301.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    var PeriodicalExecuter = Class.create({
                      initialize: function(callback, frequency) {
                        this.callback = callback;
                        this.frequency = frequency;
                        this.currentlyExecuting = false;
                    Web.Admin/2014/wordpress/wp-includes/js/prototype.js on lines 287..320

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 248.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    var PeriodicalExecuter = Class.create({
                      initialize: function(callback, frequency) {
                        this.callback = callback;
                        this.frequency = frequency;
                        this.currentlyExecuting = false;
                    Severity: Major
                    Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.js and 1 other location - About 1 day to fix
                    Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/prototype.js on lines 287..320

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 248.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Function patch has 266 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    patch: function (){
                                        api.flashEngine = true;
                    
                                        // FileAPI
                                        _inherit(api, {
                    Severity: Major
                    Found in Web.Admin/z-scripts/FileAPI.js - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language