CaffGeek/MBACNationals

View on GitHub

Showing 7,504 of 7,504 total issues

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

    wpautop : function(pee) {
        var t = this, o = { o: t, data: pee, unfiltered: pee };

        jQuery('body').trigger('beforeWpautop', [o]);
        o.data = t._wp_Autop(o.data);
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/js/editor.dev.js and 1 other location - About 3 hrs to fix
Web.Admin/2014/wordpress/wp-admin/js/editor.dev.js on lines 179..186

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

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

    protected function name()
    {
        $len = strcspn($this->data, "\x0A:", $this->position);
        if (isset($this->data[$this->position + $len]))
        {
Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 8128..8149

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

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 name()
    {
        $len = strcspn($this->data, "\x0A:", $this->position);
        if (isset($this->data[$this->position + $len]))
        {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 3 hrs to fix
Web.Admin/2014/wordpress/wp-includes/SimplePie/HTTP/Parser.php on lines 289..310

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

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 _setupModel has 87 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _setupModel: function() {
            var self = this,
                registeredSidebar = api.Widgets.registeredSidebars.get( this.params.sidebar_id );

            this.setting.bind( function( newWidgetIds, oldWidgetIds ) {
Severity: Major
Found in Web.Admin/2014/wordpress/wp-admin/js/customize-widgets.js - About 3 hrs to fix

    Function create has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      create: function(element) {
        element = $(element);
        var options = Object.extend({ 
          element:     element,
          tag:         'li',       // assumes li children, override with tag: 'tagname'
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js - About 3 hrs to fix

      Method user_row has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function user_row( $user_object, $style = '', $role = '' ) {
          global $wp_roles;
      
          $current_user = wp_get_current_user();
      
      
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-admin/includes/template.php - About 3 hrs to fix

        Method wp_kses_hair has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function wp_kses_hair($attr, $allowed_protocols) {
            $attrarr = array ();
            $mode = 0;
            $attrname = '';
            $uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
        Severity: Major
        Found in Web.Admin/2014/wordpress/wp-includes/kses.php - About 3 hrs to fix

          Method wp_timezone_choice has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function wp_timezone_choice( $selected_zone ) {
              static $mo_loaded = false;
          
              $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific');
          
          
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/functions.php - About 3 hrs to fix

            File edit-pages.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

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

                    if(dropon.previousSibling != element) {
                      var oldParentNode = element.parentNode;
                      element.style.visibility = "hidden"; // fix gecko rendering
                      dropon.parentNode.insertBefore(element, dropon);
                      if(dropon.parentNode!=oldParentNode) 
              Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js on lines 770..777

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

              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

              dw_Rotator.prototype.showCaption = function() {
                  if ( this.captions && this.captionId ) {
                      var el = document.getElementById( this.captionId );
                      if ( el && this.captions[this.ctr] ) {
                          el.innerHTML = this.captions[this.ctr];
              Severity: Major
              Found in Web.Admin/2014/js/dw_rotator.js and 1 other location - About 3 hrs to fix
              Web.Admin/2015/js/dw_rotator.js on lines 124..131

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

              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

              dw_Rotator.prototype.showCaption = function() {
                  if ( this.captions && this.captionId ) {
                      var el = document.getElementById( this.captionId );
                      if ( el && this.captions[this.ctr] ) {
                          el.innerHTML = this.captions[this.ctr];
              Severity: Major
              Found in Web.Admin/2015/js/dw_rotator.js and 1 other location - About 3 hrs to fix
              Web.Admin/2014/js/dw_rotator.js on lines 124..131

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

              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(nextElement != element) {
                      var oldParentNode = element.parentNode;
                      element.style.visibility = "hidden"; // fix gecko rendering
                      dropon.parentNode.insertBefore(element, nextElement);
                      if(dropon.parentNode!=oldParentNode) 
              Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/dragdrop.js on lines 759..766

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

              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

                      elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))
                      {
                          $height += 16;
                          if ($native)
                          {
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/SimplePie/Enclosure.php and 1 other location - About 3 hrs to fix
              Web.Admin/2014/wordpress/wp-includes/class-simplepie.php on lines 7123..7141

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

              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

                      elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === ''))
                      {
                          $height += 16;
                          if ($native)
                          {
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-includes/class-simplepie.php and 1 other location - About 3 hrs to fix
              Web.Admin/2014/wordpress/wp-includes/SimplePie/Enclosure.php on lines 1154..1172

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

              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 _wp_translate_postdata has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function _wp_translate_postdata( $update = false, $post_data = null ) {
              
                  if ( empty($post_data) )
                      $post_data = &$_POST;
              
              
              Severity: Major
              Found in Web.Admin/2014/wordpress/wp-admin/includes/post.php - About 3 hrs to fix

                File class-wp-filesystem-ftpext.php has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * WordPress FTP Filesystem.
                 *
                 * @package WordPress

                  Function insert has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                    Element.Methods.insert = function(element, insertions) {
                      element = $(element);
                  
                      if (Object.isString(insertions) || Object.isNumber(insertions) ||
                          Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.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 Hash has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var Hash = Class.create(Enumerable, (function() {
                    if (function() {
                      var i = 0, Test = function(value) { this.key = value };
                      Test.prototype.key = 'foo';
                      for (var property in new Test('bar')) i++;
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/prototype.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 autosave_parse_response has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function autosave_parse_response(response) {
                      var res = wpAjax.parseAjaxResponse(response, 'autosave'), message = '', postID, sup, url;
                  
                      if ( res && res.responses && res.responses.length ) {
                          message = res.responses[0].data; // The saved message or error.
                  Severity: Minor
                  Found in Web.Admin/2014/wordpress/wp-includes/js/autosave.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

                  Severity
                  Category
                  Status
                  Source
                  Language