CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

            if (ty == 'hspace') {
                dom.setStyle(img, 'marginLeft', '');
                dom.setStyle(img, 'marginRight', '');

                v = f.hspace.value;
Web.Admin/2014/wordpress/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js on lines 550..559

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

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

File wp-lists.dev.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function($) {
var fs = {add:'ajaxAdd',del:'ajaxDel',dim:'ajaxDim',process:'process',recolor:'recolor'}, wpList;

wpList = {
    settings: {
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/js/wp-lists.dev.js - About 3 hrs to fix

    Function _apply has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _apply: function (image, fn){
                var
                      canvas = getCanvas()
                    , m = this.getMatrix(image)
                    , ctx = canvas.getContext('2d')
    Severity: Major
    Found in Web.Admin/z-scripts/FileAPI.js - About 3 hrs to fix

      Function Page has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              $scope.Page = function (page, data) {
                  switch (page) {
                      case 'Game': {
                          dataService.LoadSchedule(year, data.Division).
                              success(function (divisionSchedule) {
      Severity: Major
      Found in Web.Admin/AdminApp/Controllers/controller.scoreentry.js - About 3 hrs to fix

        Function dataToHtml has 82 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function dataToHtml(data) {
                var html = '';
        
                if (!data.source1) {
                    tinymce.extend(data, htmlToData(data.embed));

          Method get_bloginfo has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function get_bloginfo($show = '', $filter = 'raw') {
          
              switch($show) {
                  case 'url' :
                  case 'home' : // DEPRECATED
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/general-template.php - About 3 hrs to fix

            Method wp_setup_nav_menu_item has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function wp_setup_nav_menu_item( $menu_item ) {
                if ( isset( $menu_item->post_type ) ) {
                    if ( 'nav_menu_item' == $menu_item->post_type ) {
                        $menu_item->db_id = (int) $menu_item->ID;
                        $menu_item->menu_item_parent = empty( $menu_item->menu_item_parent ) ? get_post_meta( $menu_item->ID, '_menu_item_menu_item_parent', true ) : $menu_item->menu_item_parent;
            Severity: Major
            Found in Web.Admin/2014/wordpress/wp-includes/nav-menu.php - About 3 hrs to fix

              Method request has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function request($url, $args = array()) {
                      $defaults = array(
                          'method' => 'GET', 'timeout' => 5,
                          'redirection' => 5, 'httpversion' => '1.0',
                          'blocking' => true,
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/http.php - About 3 hrs to fix

                File charmap.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                tinyMCEPopup.requireLangPack();
                
                var charmap = [
                    [' ',    ' ',  true, 'no-break space'],
                    ['&',     '&',   true, 'ampersand'],

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

                  function get_search_comments_feed_link($search_query = '', $feed = '') {
                      if ( empty($search_query) )
                          $search = esc_attr( urlencode(get_search_query()) );
                      else
                          $search = esc_attr( urlencode(stripslashes($search_query)) );
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/link-template.php and 1 other location - About 3 hrs to fix
                  Web.Admin/2014/wordpress/wp-includes/link-template.php on lines 620..634

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

                  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

                  function get_search_feed_link($search_query = '', $feed = '') {
                      if ( empty($search_query) )
                          $search = esc_attr( urlencode(get_search_query()) );
                      else
                          $search = esc_attr( urlencode(stripslashes($search_query)) );
                  Severity: Major
                  Found in Web.Admin/2014/wordpress/wp-includes/link-template.php and 1 other location - About 3 hrs to fix
                  Web.Admin/2014/wordpress/wp-includes/link-template.php on lines 645..659

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

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

                  function PopupWindow_isClicked(e) {
                      if (this.divName != null) {
                          if (this.use_layers) {
                              var clickX = e.pageX;
                              var clickY = e.pageY;
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/colorpicker.dev.js - About 3 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 initialize has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                    initialize: function(testcases) {
                      this.options = Object.extend({
                        testLog: 'testlog'
                      }, arguments[1] || {});
                      this.options.resultsURL = this.parseResultsURLQueryParameter();
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/unittest.js - About 3 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 calculateMovingAverage has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      SWFUpload.speed.calculateMovingAverage = function (history) {
                          var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0;
                          var i;
                          var mSum = 0, mCount = 0;
                          

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

                    function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)
                    {
                      $v_result=1;
                  
                      // ----- Read the file header
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php - About 3 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_cli_args has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function get_cli_args( $param, $required = false ) {
                      $args = $_SERVER['argv'];
                  
                      $out = array();
                  
                  
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/class-wp-importer.php - About 3 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 upgrade_210 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function upgrade_210() {
                      global $wpdb, $wp_current_db_version;
                  
                      if ( $wp_current_db_version < 3506 ) {
                          // Update status and type.
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/upgrade.php - About 3 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 mput has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function mput($local=".", $remote=NULL, $continious=false) {
                          $local=realpath($local);
                          if(!@file_exists($local)) {
                              $this->PushError("mput","can't open local folder", "Cannot stat folder \"".$local."\"");
                              return FALSE;
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-admin/includes/class-ftp.php - About 3 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 display_rows has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      function display_rows() {
                          $plugins_allowedtags = array(
                              'a' => array( 'href' => array(),'title' => array(), 'target' => array() ),
                              'abbr' => array( 'title' => array() ),'acronym' => array( 'title' => array() ),
                              'code' => array(), 'pre' => array(), 'em' => array(),'strong' => array(),

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

                      function mw_getRecentPosts($args) {
                  
                          $this->escape($args);
                  
                          $blog_ID     = (int) $args[0];
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php - About 3 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

                  Severity
                  Category
                  Status
                  Source
                  Language