CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

File upload.php has 386 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Media Library administration panel.
 *
 * @package WordPress
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-admin/upload.php - About 5 hrs to fix

    File wp-signup.php has 386 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /** Sets up the WordPress Environment. */
    require( dirname(__FILE__) . '/wp-load.php' );
    
    
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-signup.php - About 5 hrs to fix

      Function install_theme_information has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      function install_theme_information() {
          //TODO: This function needs a LOT of UI work :)
          global $tab, $themes_allowedtags;
      
          $api = themes_api('theme_information', array('slug' => stripslashes( $_REQUEST['theme'] ) ));
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/theme-install.php - About 5 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_plugins_output has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      function wp_dashboard_plugins_output() {
          $popular = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
          $new     = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/new/' );
          $updated = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/updated/' );
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/includes/dashboard.php - About 5 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 convert_tags has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          function convert_tags() {
              global $wpdb;
      
              if ( (!isset($_POST['tags_to_convert']) || !is_array($_POST['tags_to_convert'])) && empty($this->tags_to_convert)) {
                  echo '<div class="narrow">';
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/import/wp-cat2tag.php - About 5 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 auto_check_comment has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function auto_check_comment( $commentdata ) {
              self::$last_comment_result = null;
      
              $comment = $commentdata;
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-content/plugins/akismet/class.akismet.php - About 5 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_simplepie_object_for_cache has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static function prepare_simplepie_object_for_cache($data)
          {
              $items = $data->get_items();
              $items_by_id = array();
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Cache/DB.php - About 5 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_simplepie_object_for_cache has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          function prepare_simplepie_object_for_cache($data)
          {
              $items = $data->get_items();
              $items_by_id = array();
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php - About 5 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 start_element has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          function start_element($parser, $name, $attrs) {
      
              $tag = array_pop(split(":", $name));
      
              switch($name) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/atomlib.php - About 5 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_list_comments has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      function wp_list_comments($args = array(), $comments = null ) {
          global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop;
      
          $in_comment_loop = true;
      
      
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/comment-template.php - About 5 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

      Method screen_meta has 131 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function screen_meta($screen) {
          global $wp_meta_boxes, $_wp_contextual_help;
      
          $screen = str_replace('.php', '', $screen);
          $screen = str_replace('-new', '', $screen);
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 5 hrs to fix

        Method dbDelta has 131 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function dbDelta($queries, $execute = true) {
            global $wpdb;
        
            // Separate individual queries into an array
            if( !is_array($queries) ) {
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-admin/includes/upgrade.php - About 5 hrs to fix

          Function patchEditor has 130 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function patchEditor(editor) {
                  function patchEditorEvents(oldEventNames, argsMap) {
                      tinymce.each(oldEventNames.split(" "), function(oldName) {
                          editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
                      });

            Method populate_options has 130 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function populate_options() {
                global $wpdb, $wp_db_version;
            
                $guessurl = wp_guess_url();
            
            
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-admin/includes/schema.php - About 5 hrs to fix

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

                      {
                          if (e.ctrlKey) return true;
                          shift_down = e.shiftKey ? true : false;
                          var nudge = shift_down ? 10 : 1;
                          switch(e.keyCode)
              Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js on lines 105..107

              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 139.

              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

                                  for (var i = 0; i < scope.shots.length; i++) {
                                      if (scope.shots[i] === '1') {
                                          shots.push(scope.shots[i] + scope.shots[++i]);
                                      } else if (scope.shots[i] === 'F') {
                                          scope.game.fouls++;
              Severity: Major
              Found in Web.Admin/ClientApp/Controllers/controller.results.js and 1 other location - About 5 hrs to fix
              Web.Admin/AdminApp/Controllers/controller.stepladder.js on lines 93..101

              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 139.

              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

              {if(e.ctrlKey)return true;shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode)
              {case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:Selection.release();break;case 9:return true;}
              return nothing(e);};if(options.keySupport)$keywrap.insertBefore($img);return{watchKeys:watchKeys};}();function px(n){return''+parseInt(n)+'px';};function pct(n){return''+parseInt(n)+'%';};function cssClass(cl){return options.baseClass+'-'+cl;};function getPos(obj)
              Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js on lines 761..778

              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 139.

              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

                                  for (var i = 0; i < scope.shots.length; i++) {
                                      if (scope.shots[i] === '1') {
                                          shots.push(scope.shots[i] + scope.shots[++i]);
                                      } else if (scope.shots[i] === 'F') {
                                          scope.game.fouls++;
              Severity: Major
              Found in Web.Admin/AdminApp/Controllers/controller.stepladder.js and 1 other location - About 5 hrs to fix
              Web.Admin/ClientApp/Controllers/controller.results.js on lines 134..142

              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 139.

              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

                  switch ( $post->post_type ) :
                  case 'page' :
                      if ( !current_user_can( 'delete_page', $post->ID ) )
                          return;
                      $file = 'page';
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/link-template.php and 1 other location - About 5 hrs to fix
              Web.Admin/2014/wordpress/wp-includes/link-template.php on lines 682..708

              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 187.

              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

                  switch ( $post->post_type ) :
                  case 'page' :
                      if ( !current_user_can( 'edit_page', $post->ID ) )
                          return;
                      $file = 'page';
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/link-template.php and 1 other location - About 5 hrs to fix
              Web.Admin/2014/wordpress/wp-includes/link-template.php on lines 758..784

              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 187.

              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

              Severity
              Category
              Status
              Source
              Language