CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

    if (1)
    {
      // ----- Extract time
      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php and 1 other location - About 3 hrs to fix
Web.Admin/2014/wordpress/wp-admin/includes/class-pclzip.php on lines 4331..4350

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

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

Method MultiByteCharString2HTML has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {
        $string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string
        $HTMLstring = '';

        switch ($charset) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/ID3/getid3.lib.php - About 3 hrs to fix

    Method feed_start_element has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function feed_start_element($p, $element, &$attrs) {
            $el = $element = strtolower($element);
            $attrs = array_change_key_case($attrs, CASE_LOWER);
    
            // check for a namespace, and split if found
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/rss.php - About 3 hrs to fix

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

              if(isset($content_struct["mt_allow_pings"])) {
                  if(!is_numeric($content_struct["mt_allow_pings"])) {
                      switch($content_struct['mt_allow_pings']) {
                          case "closed":
                              $ping_status = "closed";
      Severity: Major
      Found in Web.Admin/2014/wordpress/xmlrpc.php and 1 other location - About 3 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/class-wp-xmlrpc-server.php on lines 4517..4545

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

      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 ( isset($content_struct['mt_allow_pings']) ) {
                  if ( !is_numeric($content_struct['mt_allow_pings']) ) {
                      switch ( $content_struct['mt_allow_pings'] ) {
                          case 'closed':
                              $ping_status = 'closed';
      Web.Admin/2014/wordpress/xmlrpc.php on lines 2156..2186

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

      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 wp_ajax_delete_page( $action ) {
          if ( empty( $action ) )
              $action = 'delete-page';
          $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
      
      
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php and 1 other location - About 3 hrs to fix
      Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php on lines 505..521

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

      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 wp_ajax_delete_post( $action ) {
          if ( empty( $action ) )
              $action = 'delete-post';
          $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
      
      
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php and 1 other location - About 3 hrs to fix
      Web.Admin/2014/wordpress/wp-admin/includes/ajax-actions.php on lines 552..568

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

      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

                  Util.getSessionStorage = function (name) {
                      var storage = Util._getSessionStorageObject();
                      if (storage !== null) {
                          try {
                              return storage.getItem(name);
      Severity: Major
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 1 other location - About 3 hrs to fix
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 103..114

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

      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 3 locations. Consider refactoring.
      Open

                          DataSanitizer.sanitizeException = function (exception) {
                              if (exception) {
                                  if (exception.length > DataSanitizer.MAX_EXCEPTION_LENGTH) {
                                      exception = exception.substring(0, DataSanitizer.MAX_EXCEPTION_LENGTH);
                                      ApplicationInsights._InternalLogging.throwInternalUserActionable(1 /* WARNING */, "exception is too long, iit has been trucated to " + DataSanitizer.MAX_EXCEPTION_LENGTH + " characters.  exception: " + exception);
      Severity: Major
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 2 other locations - About 3 hrs to fix
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1136..1144
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1145..1153

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

      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 3 locations. Consider refactoring.
      Open

                          DataSanitizer.sanitizeUrl = function (url) {
                              if (url) {
                                  if (url.length > DataSanitizer.MAX_URL_LENGTH) {
                                      url = url.substring(0, DataSanitizer.MAX_URL_LENGTH);
                                      ApplicationInsights._InternalLogging.throwInternalUserActionable(1 /* WARNING */, "url is too long, it has been trucated to " + DataSanitizer.MAX_URL_LENGTH + " characters. url: " + url);
      Severity: Major
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 2 other locations - About 3 hrs to fix
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1145..1153
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1154..1162

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

      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

      opt.keySupport=$.browser.msie?false:true;var defaults={trackDocument:false,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:.6,borderOpacity:.4,handleOpacity:.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var options=defaults;setOptions(opt);var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css({position:'absolute'});$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);;if(options.addClass)$div.addClass(options.addClass);var $img2=$('<img />').attr('src',$img.attr('src')).css('position','absolute').width(boundx).height(boundy);var $img_holder=$('<div />').width(pct(100)).height(pct(100)).css({zIndex:310,position:'absolute',overflow:'hidden'}).append($img2);var $hdl_holder=$('<div />').width(pct(100)).height(pct(100)).css('zIndex',320);var $sel=$('<div />').css({position:'absolute',zIndex:300}).insertBefore($img).append($img_holder,$hdl_holder);var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:'absolute',top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var xlimit,ylimit,xmin,ymin;var xscale,yscale,enabled=true;var docOffset=getPos($img),btndown,lastcurs,dimmed,animating,shift_down;var Coords=function()
      Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.dev.js on lines 116..125

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

      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 boundx = $img.width(),
              boundy = $img.height(),
      
              $div = $('<div />')
                  .width(boundx).height(boundy)
      Web.Admin/2014/wordpress/wp-includes/js/jcrop/jquery.Jcrop.js on lines 14..14

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

      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 3 locations. Consider refactoring.
      Open

                          DataSanitizer.sanitizeMessage = function (message) {
                              if (message) {
                                  if (message.length > DataSanitizer.MAX_MESSAGE_LENGTH) {
                                      message = message.substring(0, DataSanitizer.MAX_MESSAGE_LENGTH);
                                      ApplicationInsights._InternalLogging.throwInternalUserActionable(1 /* WARNING */, "message is too long, it has been trucated to " + DataSanitizer.MAX_MESSAGE_LENGTH + " characters.  message: " + message);
      Severity: Major
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 2 other locations - About 3 hrs to fix
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1136..1144
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 1154..1162

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

      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

                  Util.getStorage = function (name) {
                      var storage = Util._getStorageObject();
                      if (storage !== null) {
                          try {
                              return storage.getItem(name);
      Severity: Major
      Found in Web.Admin/z-scripts/ai.0.15.0-build46802.js and 1 other location - About 3 hrs to fix
      Web.Admin/z-scripts/ai.0.15.0-build46802.js on lines 158..169

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

      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 edit.php has 306 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Edit Posts Administration Panel.
       *
       * @package WordPress
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-admin/edit.php - About 3 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
                (t == 'checkbox' || t == 'radio') && !el.checked ||
                (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
                tag == 'select' && el.selectedIndex == -1))
                    return null;
        Severity: Critical
        Found in Web.Admin/2014/wordpress/wp-includes/js/jquery/jquery.form.dev.js - About 3 hrs to fix

          WP_Filesystem_Direct has 28 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class WP_Filesystem_Direct extends WP_Filesystem_Base {
              var $errors = null;
              /**
               * constructor
               *

            LJ_API_Import has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class LJ_API_Import {
            
                var $comments_url = 'http://www.livejournal.com/export_comments.bml';
                var $ixr_url      = 'http://www.livejournal.com/interface/xmlrpc';
                var $ixr;
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-admin/import/livejournal.php - About 3 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                          if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
                          || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')
                          || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_20 && in_array(end($this->element), array('title')))
                          || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_090 && in_array(end($this->element), array('title')))
                          || (end($this->namespace) === SIMPLEPIE_NAMESPACE_RSS_10 && in_array(end($this->element), array('title'))))
              Severity: Critical
              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Parser.php - About 3 hrs to fix

                Function success has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            success: function() {
                
                                // calculate some cropping
                                var newWidth = ( width - options.margin * 2 ) / self.original.width,
                                    newHeight = ( height - options.margin * 2 ) / self.original.height,
                Severity: Major
                Found in Web.Admin/2015/js/galleria/galleria-1.4.2.js - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language